- 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(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityResolvergetEntityResolver()Returns entity resolver of the parser.ErrorHandlergetErrorHandler()Returns error handler of the parser.intgetValidationMode()Returns validtion mode of the parser.SchemagetXMLSchema()Returns XML Schema of the parser.Documentparse(File file)Parses given file.Documentparse(InputStream inputStream)Parses given input stream.Documentparse(Reader reader)Parses given reader.Documentparse(URL url)Parses given url.Documentparse(Source source)Parses given source.Documentparse(InputSource inputSource)Parses given input source.voidsetEntityResolver(EntityResolver entityResolver)Sets entity resolver for the parser.voidsetErrorHandler(ErrorHandler errorHandler)Sets error handler for the parser.voidsetNamespaceAware(boolean isNamespaceAware)Changes namespaceAware behavior of the parser.voidsetValidationMode(int validationMode)Sets validation mode of the parser.voidsetWhitespacePreserving(boolean isWhitespacePreserving)Changes preservation of white spaces.voidsetXMLSchema(URL url)Sets XML Schema for the parser.voidsetXMLSchema(Schema schema)Sets XML Schema for the parser.voidsetXMLSchemas(Object[] schemas)Sets XML Schema(s) for the parser.
-
-
-
Constructor Detail
-
JAXPParser
public JAXPParser()
Default constructor.
-
JAXPParser
public JAXPParser(DocumentBuilderFactory documentBuilderFactory, ErrorHandler errorHandler)
This constructor can increase performance by providing existing documentBuilderFactory and errorHandler.- Parameters:
documentBuilderFactory- existing document builder factoryerrorHandler- existing error handler
-
-
Method Detail
-
setNamespaceAware
public void setNamespaceAware(boolean isNamespaceAware)
Changes namespaceAware behavior of the parser.- Specified by:
setNamespaceAwarein interfaceXMLParser- Parameters:
isNamespaceAware- if the parser should be namespace aware
-
setWhitespacePreserving
public void setWhitespacePreserving(boolean isWhitespacePreserving)
Changes preservation of white spaces.- Specified by:
setWhitespacePreservingin interfaceXMLParser- Parameters:
isWhitespacePreserving- if the parser should preserve white spaces
-
getValidationMode
public int getValidationMode()
Returns validtion mode of the parser.- Specified by:
getValidationModein interfaceXMLParser- Returns:
- validation mode of the parser
-
setValidationMode
public void setValidationMode(int validationMode)
Sets validation mode of the parser.- Specified by:
setValidationModein interfaceXMLParser- Parameters:
validationMode- validation mode to set
-
getEntityResolver
public EntityResolver getEntityResolver()
Returns entity resolver of the parser.- Specified by:
getEntityResolverin interfaceXMLParser- Returns:
- entity resolver of the parser
-
setEntityResolver
public void setEntityResolver(EntityResolver entityResolver)
Sets entity resolver for the parser.- Specified by:
setEntityResolverin interfaceXMLParser- Parameters:
entityResolver- entity resolver to set
-
getErrorHandler
public ErrorHandler getErrorHandler()
Returns error handler of the parser.- Specified by:
getErrorHandlerin interfaceXMLParser- Returns:
- error handler of the parser
-
setErrorHandler
public void setErrorHandler(ErrorHandler errorHandler)
Sets error handler for the parser.- Specified by:
setErrorHandlerin interfaceXMLParser- Parameters:
errorHandler- error handler for the parser
-
setXMLSchema
public void setXMLSchema(URL url) throws XMLPlatformException
Sets XML Schema for the parser.- Specified by:
setXMLSchemain interfaceXMLParser- Parameters:
url- url of the XMLSchema- Throws:
XMLPlatformException- exception occurred while setting XMLSchema
-
setXMLSchema
public void setXMLSchema(Schema schema) throws XMLPlatformException
Sets XML Schema for the parser.- Specified by:
setXMLSchemain interfaceXMLParser- Parameters:
schema- schema for the parser- Throws:
XMLPlatformException- exception occurred while setting XMLSchema
-
getXMLSchema
public Schema getXMLSchema() throws XMLPlatformException
Returns XML Schema of the parser.- Specified by:
getXMLSchemain interfaceXMLParser- Returns:
- schema of the parser
- Throws:
XMLPlatformException- exception occurred while getting XMLSchema
-
setXMLSchemas
public void setXMLSchemas(Object[] schemas) throws XMLPlatformException
Sets XML Schema(s) for the parser.- Specified by:
setXMLSchemasin interfaceXMLParser- Parameters:
schemas- XML schemas to set- Throws:
XMLPlatformException- exception occurred while setting XMLSchema(s)
-
parse
public Document parse(InputSource inputSource) throws XMLPlatformException
Parses given input source.- Specified by:
parsein interfaceXMLParser- Parameters:
inputSource- input source to parse- Returns:
- parsed document
- Throws:
XMLPlatformException- exception occurred while parsing input source
-
parse
public Document parse(File file) throws XMLPlatformException
Parses given file.- Specified by:
parsein interfaceXMLParser- Parameters:
file- file to parse- Returns:
- parsed document
- Throws:
XMLPlatformException- exception occurred while parsing given file
-
parse
public Document parse(InputStream inputStream) throws XMLPlatformException
Parses given input stream.- Specified by:
parsein interfaceXMLParser- Parameters:
inputStream- input stream to parse- Returns:
- parsed document
- Throws:
XMLPlatformException- exception occurred while parsing input stream
-
parse
public Document parse(Reader reader) throws XMLPlatformException
Parses given reader.- Specified by:
parsein interfaceXMLParser- Parameters:
reader- reader to parse- Returns:
- parsed document
- Throws:
XMLPlatformException- exception occurred while parsing given reader
-
parse
public Document parse(Source source) throws XMLPlatformException
Parses given source.- Specified by:
parsein interfaceXMLParser- Parameters:
source- source to parse- Returns:
- parsed document
- Throws:
XMLPlatformException- exception occurred while parsing given source
-
parse
public Document parse(URL url) throws XMLPlatformException
Parses given url.- Specified by:
parsein interfaceXMLParser- Parameters:
url- url to parse- Returns:
- parsed document
- Throws:
XMLPlatformException- exception occurred while parsing stream with given url
-
-