|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.optimizationservices.oscommon.util.XPathUtil
public class XPathUtil
The XPathUtil
class contains methods for performing
common basic XPath-related operations used by various classes in the
Optimization Services (OS) framework.
Constructor Summary | |
---|---|
XPathUtil(java.lang.String xmlData,
boolean isFile)
constructor. |
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
main for test purposes. |
static java.lang.String |
printQueryResult(java.util.List queryResult)
Print out the query result to a string for easy reading. |
java.util.List |
query(java.lang.String xPathString,
java.util.HashMap variables)
Use an XPath string to query xml data. |
java.lang.String |
queryFirst(java.lang.String xPathString,
java.util.HashMap variables)
Use an XPath string to query xml data and return the first found object in a string. |
static java.lang.String |
queryResultToString(java.util.List queryResult)
Convert a query result to a string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XPathUtil(java.lang.String xmlData, boolean isFile)
xmlData
- holds the name of the xml data to be queried. If null, the xml data
will be located from within the xPath, i.e. the doc(...) section of xpath. The xmlData
can either be a file name or an actual string that holds the xml data.isFile
- holds whether the xmlData is a a file name or, otherwise (if false) an actual string
that holds the xml data.Method Detail |
---|
public java.util.List query(java.lang.String xPathString, java.util.HashMap variables)
xPathString
- holds the XPath string that can be used to query xml data.variables
- holds a hashmap of external variable name-value paris to be fed into the the XPath.
java.util.List
. If there is an error querying, returns null.public java.lang.String queryFirst(java.lang.String xPathString, java.util.HashMap variables)
xPathString
- holds the XPath string that can be used to query xml data.variables
- holds a hashmap of external variable name-value paris to be fed into the the XPath.
public static java.lang.String printQueryResult(java.util.List queryResult)
queryResult
- holds a list of query result in type java.util.List
.
public static java.lang.String queryResultToString(java.util.List queryResult)
queryResult
- holds a list of query result in type java.util.List
.
public static void main(java.lang.String[] args)
argv
- command line arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |