Class JAXPParser
- java.lang.Object
-
- org.eclipse.persistence.platform.xml.jaxp.JAXPParser
-
-
Field Summary
-
Fields inherited from interface org.eclipse.persistence.platform.xml.XMLParser
DTD_VALIDATION, NONVALIDATING, SCHEMA_VALIDATION
-
-
Constructor Summary
Constructors Constructor Description JAXPParser()
Default constructor.JAXPParser(java.util.Map<java.lang.String,java.lang.Boolean> parserFeatures)
This constructor provides way to specify features for parser.JAXPParser(javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory, org.xml.sax.ErrorHandler errorHandler)
This constructor can increase performance by providing existing documentBuilderFactory and errorHandler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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(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(java.net.URL url)
Parses given url.org.w3c.dom.Document
parse(javax.xml.transform.Source source)
Parses given source.org.w3c.dom.Document
parse(org.xml.sax.InputSource inputSource)
Parses given input source.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(java.net.URL url)
Sets XML Schema for the parser.void
setXMLSchema(javax.xml.validation.Schema schema)
Sets XML Schema for the parser.void
setXMLSchemas(java.lang.Object[] schemas)
Sets XML Schema(s) for the parser.
-
-
-
Constructor Detail
-
JAXPParser
public JAXPParser()
Default constructor.
-
JAXPParser
public JAXPParser(javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory, org.xml.sax.ErrorHandler errorHandler)
This constructor can increase performance by providing existing documentBuilderFactory and errorHandler.- Parameters:
documentBuilderFactory
- existing document builder factoryerrorHandler
- existing error handler
-
JAXPParser
public JAXPParser(java.util.Map<java.lang.String,java.lang.Boolean> parserFeatures)
This constructor provides way to specify features for parser.- Parameters:
parserFeatures
- features for parser
-
-
Method Detail
-
setNamespaceAware
public void setNamespaceAware(boolean isNamespaceAware)
Changes namespaceAware behavior of the parser.- Specified by:
setNamespaceAware
in interfaceXMLParser
- Parameters:
isNamespaceAware
- if the parser should be namespace aware
-
setWhitespacePreserving
public void setWhitespacePreserving(boolean isWhitespacePreserving)
Changes preservation of white spaces.- Specified by:
setWhitespacePreserving
in interfaceXMLParser
- Parameters:
isWhitespacePreserving
- if the parser should preserve white spaces
-
getValidationMode
public int getValidationMode()
Returns validtion mode of the parser.- Specified by:
getValidationMode
in interfaceXMLParser
- Returns:
- validation mode of the parser
-
setValidationMode
public void setValidationMode(int validationMode)
Sets validation mode of the parser.- Specified by:
setValidationMode
in interfaceXMLParser
- Parameters:
validationMode
- validation mode to set
-
getEntityResolver
public org.xml.sax.EntityResolver getEntityResolver()
Returns entity resolver of the parser.- Specified by:
getEntityResolver
in interfaceXMLParser
- Returns:
- entity resolver of the parser
-
setEntityResolver
public void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
Sets entity resolver for the parser.- Specified by:
setEntityResolver
in interfaceXMLParser
- Parameters:
entityResolver
- entity resolver to set
-
getErrorHandler
public org.xml.sax.ErrorHandler getErrorHandler()
Returns error handler of the parser.- Specified by:
getErrorHandler
in interfaceXMLParser
- Returns:
- error handler of the parser
-
setErrorHandler
public void setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
Sets error handler for the parser.- Specified by:
setErrorHandler
in interfaceXMLParser
- Parameters:
errorHandler
- error handler for the parser
-
setXMLSchema
public void setXMLSchema(java.net.URL url) throws XMLPlatformException
Sets XML Schema for the parser.- Specified by:
setXMLSchema
in interfaceXMLParser
- Parameters:
url
- url of the XMLSchema- Throws:
XMLPlatformException
- exception occurred while setting XMLSchema
-
setXMLSchema
public void setXMLSchema(javax.xml.validation.Schema schema) throws XMLPlatformException
Sets XML Schema for the parser.- Specified by:
setXMLSchema
in interfaceXMLParser
- Parameters:
schema
- schema for the parser- Throws:
XMLPlatformException
- exception occurred while setting XMLSchema
-
getXMLSchema
public javax.xml.validation.Schema getXMLSchema() throws XMLPlatformException
Returns XML Schema of the parser.- Specified by:
getXMLSchema
in interfaceXMLParser
- Returns:
- schema of the parser
- Throws:
XMLPlatformException
- exception occurred while getting XMLSchema
-
setXMLSchemas
public void setXMLSchemas(java.lang.Object[] schemas) throws XMLPlatformException
Sets XML Schema(s) for the parser.- Specified by:
setXMLSchemas
in interfaceXMLParser
- Parameters:
schemas
- XML schemas to set- Throws:
XMLPlatformException
- exception occurred while setting XMLSchema(s)
-
parse
public org.w3c.dom.Document parse(org.xml.sax.InputSource inputSource) throws XMLPlatformException
Parses given input source.- Specified by:
parse
in interfaceXMLParser
- Parameters:
inputSource
- input source to parse- Returns:
- parsed document
- Throws:
XMLPlatformException
- exception occurred while parsing input source
-
parse
public org.w3c.dom.Document parse(java.io.File file) throws XMLPlatformException
Parses given file.- Specified by:
parse
in interfaceXMLParser
- Parameters:
file
- file to parse- Returns:
- parsed document
- Throws:
XMLPlatformException
- exception occurred while parsing given file
-
parse
public org.w3c.dom.Document parse(java.io.InputStream inputStream) throws XMLPlatformException
Parses given input stream.- Specified by:
parse
in interfaceXMLParser
- Parameters:
inputStream
- input stream to parse- Returns:
- parsed document
- Throws:
XMLPlatformException
- exception occurred while parsing input stream
-
parse
public org.w3c.dom.Document parse(java.io.Reader reader) throws XMLPlatformException
Parses given reader.- Specified by:
parse
in interfaceXMLParser
- Parameters:
reader
- reader to parse- Returns:
- parsed document
- Throws:
XMLPlatformException
- exception occurred while parsing given reader
-
parse
public org.w3c.dom.Document parse(javax.xml.transform.Source source) throws XMLPlatformException
Parses given source.- Specified by:
parse
in interfaceXMLParser
- Parameters:
source
- source to parse- Returns:
- parsed document
- Throws:
XMLPlatformException
- exception occurred while parsing given source
-
parse
public org.w3c.dom.Document parse(java.net.URL url) throws XMLPlatformException
Parses given url.- Specified by:
parse
in interfaceXMLParser
- Parameters:
url
- url to parse- Returns:
- parsed document
- Throws:
XMLPlatformException
- exception occurred while parsing stream with given url
-
-