DTD_VALIDATION, NONVALIDATING, SCHEMA_VALIDATION
Constructor and Description |
---|
JAXPParser()
Default constructor.
|
JAXPParser(javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory,
org.xml.sax.ErrorHandler errorHandler)
This constructor can increase performance by providing existing documentBuilderFactory and errorHandler.
|
JAXPParser(java.util.Map<java.lang.String,java.lang.Boolean> parserFeatures)
This constructor provides way to specify features for parser.
|
Modifier and Type | Method and Description |
---|---|
org.xml.sax.EntityResolver |
getEntityResolver()
Returns entity resolver of the parser.
|
org.xml.sax.ErrorHandler |
getErrorHandler()
Returns error handler of the parser.
|
int |
getValidationMode()
Returns validtion mode of the parser.
|
javax.xml.validation.Schema |
getXMLSchema()
Returns XML Schema of the parser.
|
org.w3c.dom.Document |
parse(java.io.File file)
Parses given file.
|
org.w3c.dom.Document |
parse(org.xml.sax.InputSource inputSource)
Parses given input source.
|
org.w3c.dom.Document |
parse(java.io.InputStream inputStream)
Parses given input stream.
|
org.w3c.dom.Document |
parse(java.io.Reader reader)
Parses given reader.
|
org.w3c.dom.Document |
parse(javax.xml.transform.Source source)
Parses given source.
|
org.w3c.dom.Document |
parse(java.net.URL url)
Parses given url.
|
void |
setEntityResolver(org.xml.sax.EntityResolver entityResolver)
Sets entity resolver for the parser.
|
void |
setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
Sets error handler for the parser.
|
void |
setNamespaceAware(boolean isNamespaceAware)
Changes namespaceAware behavior of the parser.
|
void |
setValidationMode(int validationMode)
Sets validation mode of the parser.
|
void |
setWhitespacePreserving(boolean isWhitespacePreserving)
Changes preservation of white spaces.
|
void |
setXMLSchema(javax.xml.validation.Schema schema)
Sets XML Schema for the parser.
|
void |
setXMLSchema(java.net.URL url)
Sets XML Schema for the parser.
|
void |
setXMLSchemas(java.lang.Object[] schemas)
Sets XML Schema(s) for the parser.
|
public JAXPParser()
public JAXPParser(javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory, org.xml.sax.ErrorHandler errorHandler)
documentBuilderFactory
- existing document builder factoryerrorHandler
- existing error handlerpublic JAXPParser(java.util.Map<java.lang.String,java.lang.Boolean> parserFeatures)
parserFeatures
- features for parserpublic void setNamespaceAware(boolean isNamespaceAware)
setNamespaceAware
in interface XMLParser
isNamespaceAware
- if the parser should be namespace awarepublic void setWhitespacePreserving(boolean isWhitespacePreserving)
setWhitespacePreserving
in interface XMLParser
isWhitespacePreserving
- if the parser should preserve white spacespublic int getValidationMode()
getValidationMode
in interface XMLParser
public void setValidationMode(int validationMode)
setValidationMode
in interface XMLParser
validationMode
- validation mode to setpublic org.xml.sax.EntityResolver getEntityResolver()
getEntityResolver
in interface XMLParser
public void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
setEntityResolver
in interface XMLParser
entityResolver
- entity resolver to setpublic org.xml.sax.ErrorHandler getErrorHandler()
getErrorHandler
in interface XMLParser
public void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
setErrorHandler
in interface XMLParser
errorHandler
- error handler for the parserpublic void setXMLSchema(java.net.URL url) throws XMLPlatformException
setXMLSchema
in interface XMLParser
url
- url of the XMLSchemaXMLPlatformException
- exception occurred while setting XMLSchemapublic void setXMLSchema(javax.xml.validation.Schema schema) throws XMLPlatformException
setXMLSchema
in interface XMLParser
schema
- schema for the parserXMLPlatformException
- exception occurred while setting XMLSchemapublic javax.xml.validation.Schema getXMLSchema() throws XMLPlatformException
getXMLSchema
in interface XMLParser
XMLPlatformException
- exception occurred while getting XMLSchemapublic void setXMLSchemas(java.lang.Object[] schemas) throws XMLPlatformException
setXMLSchemas
in interface XMLParser
schemas
- XML schemas to setXMLPlatformException
- exception occurred while setting XMLSchema(s)public org.w3c.dom.Document parse(org.xml.sax.InputSource inputSource) throws XMLPlatformException
parse
in interface XMLParser
inputSource
- input source to parseXMLPlatformException
- exception occurred while parsing input sourcepublic org.w3c.dom.Document parse(java.io.File file) throws XMLPlatformException
parse
in interface XMLParser
file
- file to parseXMLPlatformException
- exception occurred while parsing given filepublic org.w3c.dom.Document parse(java.io.InputStream inputStream) throws XMLPlatformException
parse
in interface XMLParser
inputStream
- input stream to parseXMLPlatformException
- exception occurred while parsing input streampublic org.w3c.dom.Document parse(java.io.Reader reader) throws XMLPlatformException
parse
in interface XMLParser
reader
- reader to parseXMLPlatformException
- exception occurred while parsing given readerpublic org.w3c.dom.Document parse(javax.xml.transform.Source source) throws XMLPlatformException
parse
in interface XMLParser
source
- source to parseXMLPlatformException
- exception occurred while parsing given sourcepublic org.w3c.dom.Document parse(java.net.URL url) throws XMLPlatformException
parse
in interface XMLParser
url
- url to parseXMLPlatformException
- exception occurred while parsing stream with given url