Package org.openremote.container.xml
Class DOMParser<D extends DOM>
java.lang.Object
org.openremote.container.xml.DOMParser<D>
- All Implemented Interfaces:
EntityResolver,ErrorHandler
public abstract class DOMParser<D extends DOM>
extends Object
implements ErrorHandler, EntityResolver
Condensed API for parsing of XML into DOM with (optional) XML schema validation.
Provides many XML utility features, like pretty printing, escaping, or node visitor.
NOTE: This class is not thread-safe because JAXP factories are not thread-safe!
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaccept(Node node, DOMParser.NodeVisitor visitor) protected abstract DcreateFactory(boolean validating) createTransformer(String method, int indent, boolean standalone) createXPath(NamespaceContext nsContext) createXPath(XPathFactory factory, NamespaceContext nsContext) voidstatic Stringstatic StringvoidgetXPathResult(DOMElement<?, ?> element, XPath xpath, String expr, QName result) getXPathResult(DOM dom, XPath xpath, String expr, QName result) getXPathResult(Node context, XPath xpath, String expr, QName result) booleanisIgnorableWSNode(Node node) parse(InputStream stream) parse(InputStream stream, boolean validate) parse(InputSource source, boolean validate) voidremoveIgnorableWSNodes(Element element) resolveEntity(String publicId, String systemId) static StringstripElements(String xml) protected ParserExceptionvoidvoidvoidvoidvoidvoidstatic Stringstatic String
-
Field Details
-
schemaSources
-
schema
-
-
Constructor Details
-
DOMParser
-
-
Method Details
-
getSchema
-
createDOM
-
createFactory
- Throws:
ParserException
-
createTransformer
public Transformer createTransformer(String method, int indent, boolean standalone) throws ParserException - Throws:
ParserException
-
createDocument
-
parse
- Throws:
ParserException
-
parse
- Throws:
ParserException
-
parse
- Throws:
ParserException
-
parse
- Throws:
ParserException
-
parse
- Throws:
ParserException
-
parse
- Throws:
ParserException
-
parse
- Throws:
ParserException
-
parse
- Throws:
ParserException
-
parse
- Throws:
ParserException
-
validate
- Throws:
ParserException
-
validate
- Throws:
ParserException
-
validate
- Throws:
ParserException
-
validate
- Throws:
ParserException
-
validate
- Throws:
ParserException
-
createXPathFactory
-
createXPath
-
createXPath
-
getXPathResult
-
getXPathResult
-
getXPathResult
-
print
- Throws:
ParserException
-
print
- Throws:
ParserException
-
print
- Throws:
ParserException
-
print
- Throws:
ParserException
-
print
- Throws:
ParserException
-
print
- Throws:
ParserException
-
print
- Throws:
ParserException
-
printHTML
- Throws:
ParserException
-
printHTML
public String printHTML(Document dom, int indent, boolean standalone, boolean doctype) throws ParserException - Throws:
ParserException
-
removeIgnorableWSNodes
-
isIgnorableWSNode
-
warning
- Specified by:
warningin interfaceErrorHandler- Throws:
SAXException
-
error
- Specified by:
errorin interfaceErrorHandler- Throws:
SAXException
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler- Throws:
SAXException
-
unwrapException
-
resolveEntity
- Specified by:
resolveEntityin interfaceEntityResolver- Throws:
SAXExceptionIOException
-
escape
-
escape
-
stripElements
-
accept
-
wrap
-
wrap
-