Class JAXPParser
java.lang.Object
org.eclipse.persistence.platform.xml.jaxp.JAXPParser
- All Implemented Interfaces:
XMLParser
Purpose: An implementation of XMLParser using JAXP 1.3 APIs.
JAXPParser is NOT thread safe.
-
Field Summary
Fields inherited from interface org.eclipse.persistence.platform.xml.XMLParser
DTD_VALIDATION, NONVALIDATING, SCHEMA_VALIDATION
-
Constructor Summary
ConstructorDescriptionDefault constructor.JAXPParser
(Map<String, Boolean> parserFeatures) This constructor provides way to specify features for parser.JAXPParser
(DocumentBuilderFactory documentBuilderFactory, ErrorHandler errorHandler) This constructor can increase performance by providing existing documentBuilderFactory and errorHandler. -
Method Summary
Modifier and TypeMethodDescriptionReturns entity resolver of the parser.Returns error handler of the parser.int
Returns validtion mode of the parser.Returns XML Schema of the parser.Parses given file.parse
(InputStream inputStream) Parses given input stream.Parses given reader.Parses given url.Parses given source.parse
(InputSource inputSource) Parses given input source.void
setEntityResolver
(EntityResolver entityResolver) Sets entity resolver for the parser.void
setErrorHandler
(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
(URL url) Sets XML Schema for the parser.void
setXMLSchema
(Schema schema) Sets XML Schema for the parser.void
setXMLSchemas
(Object[] schemas) Sets XML Schema(s) for the parser.
-
Constructor Details
-
JAXPParser
public JAXPParser()Default constructor. -
JAXPParser
This constructor can increase performance by providing existing documentBuilderFactory and errorHandler.- Parameters:
documentBuilderFactory
- existing document builder factoryerrorHandler
- existing error handler
-
JAXPParser
This constructor provides way to specify features for parser.- Parameters:
parserFeatures
- features for parser
-
-
Method Details
-
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
Returns entity resolver of the parser.- Specified by:
getEntityResolver
in interfaceXMLParser
- Returns:
- entity resolver of the parser
-
setEntityResolver
Sets entity resolver for the parser.- Specified by:
setEntityResolver
in interfaceXMLParser
- Parameters:
entityResolver
- entity resolver to set
-
getErrorHandler
Returns error handler of the parser.- Specified by:
getErrorHandler
in interfaceXMLParser
- Returns:
- error handler of the parser
-
setErrorHandler
Sets error handler for the parser.- Specified by:
setErrorHandler
in interfaceXMLParser
- Parameters:
errorHandler
- error handler for the parser
-
setXMLSchema
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
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
Returns XML Schema of the parser.- Specified by:
getXMLSchema
in interfaceXMLParser
- Returns:
- schema of the parser
- Throws:
XMLPlatformException
- exception occurred while getting XMLSchema
-
setXMLSchemas
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
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
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
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
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
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
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
-