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 void
accept
(Node node, DOMParser.NodeVisitor visitor) protected abstract D
createFactory
(boolean validating) createTransformer
(String method, int indent, boolean standalone) createXPath
(NamespaceContext nsContext) createXPath
(XPathFactory factory, NamespaceContext nsContext) void
static String
static String
void
getXPathResult
(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) boolean
isIgnorableWSNode
(Node node) parse
(InputStream stream) parse
(InputStream stream, boolean validate) parse
(InputSource source, boolean validate) void
removeIgnorableWSNodes
(Element element) resolveEntity
(String publicId, String systemId) static String
stripElements
(String xml) protected ParserException
void
void
void
void
void
void
static String
static 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:
warning
in interfaceErrorHandler
- Throws:
SAXException
-
error
- Specified by:
error
in interfaceErrorHandler
- Throws:
SAXException
-
fatalError
- Specified by:
fatalError
in interfaceErrorHandler
- Throws:
SAXException
-
unwrapException
-
resolveEntity
- Specified by:
resolveEntity
in interfaceEntityResolver
- Throws:
SAXException
IOException
-
escape
-
escape
-
stripElements
-
accept
-
wrap
-
wrap
-