public class XmlUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getValue(java.lang.String expression,
java.io.InputStream stream)
Load XML from supplied InputStream and search for the expression.
|
static <T> T |
loadDom(java.io.InputStream inputStream,
java.lang.Package domPackage,
java.lang.Class<T> expectedDomType,
org.xml.sax.XMLFilter xmlFilter)
Load XML from supplied input stream and create DOM objects from specified package.
|
public static <T> T loadDom(java.io.InputStream inputStream,
java.lang.Package domPackage,
java.lang.Class<T> expectedDomType,
org.xml.sax.XMLFilter xmlFilter)
throws javax.xml.bind.JAXBException,
UnexpectedXmlElementException
inputStream - The input stream containing the XML. Stream will not be closed at the end of the parsingdomPackage - The package containing DOM objects.expectedDomType - The expected DOM object to return, or NULL if no validation is required.javax.xml.bind.JAXBException - Thrown if an error occurs during parsing of the XML.UnexpectedXmlElementException - Thrown if an unexpected root XML element has been found.public static java.lang.String getValue(java.lang.String expression,
java.io.InputStream stream)
throws javax.xml.xpath.XPathExpressionException
expression - The expression to evaluatestream - The InputStream containing the XMLjavax.xml.xpath.XPathExpressionException - Thrown when an error occurs evaluating the expression