Class XmlObject
java.lang.Object
de.hybris.platform.integrationservices.util.XmlObject
A helper object for evaluating Json content by utilizing XPath expressions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic XmlObjectParses XML content from the input stream and creates new XML objectstatic XmlObjectcreateFrom(String xml) Parses XML content and creates new XML objectbooleanChecks whether the specified xpath exists in this XML object.Looks up a value in the parsed XMLtoString()
-
Method Details
-
createFrom
Parses XML content from the input stream and creates new XML object- Parameters:
in- an input stream containing XML- Returns:
- an object for evaluating structure of the parsed content
- Throws:
IllegalArgumentException- if the input stream fails to read or does not contain a well formed XML
-
createFrom
Parses XML content and creates new XML object- Parameters:
xml- an XML content to parse- Returns:
- an object for evaluating structure of the parsed content
- Throws:
IllegalArgumentException- if the content does not contain a well formed XML
-
get
Looks up a value in the parsed XML- Parameters:
path- a XML path, e.g.//product/code, pointing to the element whose value needs to be retrieved.- Returns:
- value of the element matching the
pathlocation.
-
exists
Checks whether the specified xpath exists in this XML object.- Parameters:
path- an xPath, e.g.//product/codeto be verified- Returns:
true, if the specified path exists in this XML object;
-
toString
-