Module org.eclipse.persistence.core
Class XMLReader
- java.lang.Object
-
- org.eclipse.persistence.internal.oxm.record.XMLReader
-
- All Implemented Interfaces:
XMLReader
- Direct Known Subclasses:
XMLReaderAdapter
public class XMLReader extends Object implements XMLReader
INTERNAL:Purpose:Provide a wrapper for an org.xml.sax.XMLReader instance and define some extra event methods that can be used by TopLink during the unmarshal process. These events are no ops in this class, but may be overridden in subclasses.
Responsibilities
- Wrap an instance of org.xml.sax.XMLReader and provide all the required API
- Provide empty implementations of some callback methods that can be overridden in subclasses
- Since:
- release specific (what release of product did this appear in)
- Author:
- mmacivor
- See Also:
DOMReader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classXMLReader.ValidatingContentHandlerValidate the SAX events reported to the ContentHandler.
-
Field Summary
Fields Modifier and Type Field Description protected Locatorlocatorstatic StringNAMESPACE_PREFIXES_FEATUREstatic StringREPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE_FEATUREprotected XMLReader.ValidatingContentHandlervalidatingContentHandler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectconvertValueBasedOnSchemaType(Field xmlField, Object value, ConversionManager conversionManager, AbstractUnmarshalRecord record)INTERNAL:ContentHandlergetContentHandler()ObjectgetCurrentObject(CoreAbstractSession session, Mapping selfRecordMapping)DTDHandlergetDTDHandler()EntityResolvergetEntityResolver()ErrorHandlergetErrorHandler()booleangetFeature(String name)LexicalHandlergetLexicalHandler()LocatorgetLocator()INTERNAL: return the Locator object associated with this readerMediaTypegetMediaType()INTERNAL:chargetNamespaceSeparator()INTERNAL: The character used to separate the prefix and uri portions when namespaces are presentObjectgetProperty(String name)ValidatorHandlergetValidatorHandler()ObjectgetValue(CharSequence characters, Class<?> dataType)This call back mechanism provides an opportunity for the XMLReader to provide an alternate conversion.booleanisInCollection()booleanisNamespaceAware()INTERNAL: Determine if namespaces will be considered during marshal/unmarshal operations.booleanisNullRecord(AbstractNullPolicy nullPolicy, Attributes atts, UnmarshalRecord record)booleanisNullRepresentedByXsiNil(AbstractNullPolicy nullPolicy)voidnewObjectEvent(Object object, Object parent, Mapping selfRecordMapping)voidparse(String systemId)voidparse(InputSource input)voidsetContentHandler(ContentHandler handler)voidsetDTDHandler(DTDHandler handler)voidsetEntityResolver(EntityResolver resolver)voidsetErrorHandler(ErrorHandler handler)voidsetFeature(String name, boolean value)voidsetLexicalHandler(LexicalHandler lexicalHandler)voidsetLocator(Locator newLocator)INTERNAL: set the Locator object to associate with this readervoidsetNamespaceAware(boolean namespaceAware)If set to true, the reader will be aware of namespaces during marshal/unmarsal operations.voidsetNamespaceSeparator(char namespaceSeparator)Sets namespace separator.voidsetProperty(String name, Object value)voidsetValidatorHandler(ValidatorHandler validatorHandler)
-
-
-
Field Detail
-
NAMESPACE_PREFIXES_FEATURE
public static final String NAMESPACE_PREFIXES_FEATURE
- See Also:
- Constant Field Values
-
REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE_FEATURE
public static final String REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE_FEATURE
- See Also:
- Constant Field Values
-
validatingContentHandler
protected XMLReader.ValidatingContentHandler validatingContentHandler
-
locator
protected Locator locator
-
-
Constructor Detail
-
XMLReader
public XMLReader(XMLReader internalReader)
-
XMLReader
public XMLReader()
-
-
Method Detail
-
getLocator
public Locator getLocator()
INTERNAL: return the Locator object associated with this reader- Since:
- 2.4
-
setLocator
public void setLocator(Locator newLocator)
INTERNAL: set the Locator object to associate with this reader- Since:
- 2.4
-
getContentHandler
public ContentHandler getContentHandler()
- Specified by:
getContentHandlerin interfaceXMLReader
-
setContentHandler
public void setContentHandler(ContentHandler handler)
- Specified by:
setContentHandlerin interfaceXMLReader
-
isNamespaceAware
public boolean isNamespaceAware()
INTERNAL: Determine if namespaces will be considered during marshal/unmarshal operations.- Since:
- 2.4
-
setNamespaceAware
public void setNamespaceAware(boolean namespaceAware)
If set to true, the reader will be aware of namespaces during marshal/unmarsal operations.- Parameters:
namespaceAware- if reader should be namespace aware- Since:
- 2.6.0
-
getNamespaceSeparator
public char getNamespaceSeparator()
INTERNAL: The character used to separate the prefix and uri portions when namespaces are present- Since:
- 2.4
-
setNamespaceSeparator
public void setNamespaceSeparator(char namespaceSeparator)
Sets namespace separator.- Parameters:
namespaceSeparator- namespace separator- Since:
- 2.6.0
-
getMediaType
public MediaType getMediaType()
INTERNAL:- Returns:
- The MediaType associated with this reader
-
convertValueBasedOnSchemaType
public Object convertValueBasedOnSchemaType(Field xmlField, Object value, ConversionManager conversionManager, AbstractUnmarshalRecord record)
INTERNAL:- Since:
- 2.4
-
getDTDHandler
public DTDHandler getDTDHandler()
- Specified by:
getDTDHandlerin interfaceXMLReader
-
setDTDHandler
public void setDTDHandler(DTDHandler handler)
- Specified by:
setDTDHandlerin interfaceXMLReader
-
setEntityResolver
public void setEntityResolver(EntityResolver resolver)
- Specified by:
setEntityResolverin interfaceXMLReader
-
getEntityResolver
public EntityResolver getEntityResolver()
- Specified by:
getEntityResolverin interfaceXMLReader
-
getErrorHandler
public ErrorHandler getErrorHandler()
- Specified by:
getErrorHandlerin interfaceXMLReader
-
setErrorHandler
public void setErrorHandler(ErrorHandler handler)
- Specified by:
setErrorHandlerin interfaceXMLReader
-
getLexicalHandler
public LexicalHandler getLexicalHandler()
-
setLexicalHandler
public void setLexicalHandler(LexicalHandler lexicalHandler)
-
getFeature
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException
- Specified by:
getFeaturein interfaceXMLReader- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
setFeature
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
- Specified by:
setFeaturein interfaceXMLReader- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
getProperty
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException
- Specified by:
getPropertyin interfaceXMLReader- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
setProperty
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
- Specified by:
setPropertyin interfaceXMLReader- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
parse
public void parse(InputSource input) throws IOException, SAXException
- Specified by:
parsein interfaceXMLReader- Throws:
IOExceptionSAXException
-
parse
public void parse(String systemId) throws IOException, SAXException
- Specified by:
parsein interfaceXMLReader- Throws:
IOExceptionSAXException
-
setValidatorHandler
public void setValidatorHandler(ValidatorHandler validatorHandler)
-
getValidatorHandler
public ValidatorHandler getValidatorHandler()
-
getCurrentObject
public Object getCurrentObject(CoreAbstractSession session, Mapping selfRecordMapping)
-
getValue
public Object getValue(CharSequence characters, Class<?> dataType)
This call back mechanism provides an opportunity for the XMLReader to provide an alternate conversion. This optimization is currently only leveraged for properties annotated with @XmlInlineBinaryData.- Parameters:
characters- The characters to be converted.dataType- The type to be converted to.- Returns:
- The converted value
-
isNullRepresentedByXsiNil
public boolean isNullRepresentedByXsiNil(AbstractNullPolicy nullPolicy)
-
isNullRecord
public boolean isNullRecord(AbstractNullPolicy nullPolicy, Attributes atts, UnmarshalRecord record)
-
isInCollection
public boolean isInCollection()
-
-