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
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)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classValidate the SAX events reported to the ContentHandler. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Locatorstatic final Stringstatic final Stringprotected XMLReader.ValidatingContentHandler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertValueBasedOnSchemaType(Field xmlField, Object value, ConversionManager conversionManager, AbstractUnmarshalRecord record) INTERNAL:getCurrentObject(CoreAbstractSession session, Mapping selfRecordMapping) booleangetFeature(String name) INTERNAL: return the Locator object associated with this readerINTERNAL:charINTERNAL: The character used to separate the prefix and uri portions when namespaces are presentgetProperty(String name) getValue(CharSequence characters, Class<?> dataType) This call back mechanism provides an opportunity for the XMLReader to provide an alternate conversion.booleanbooleanINTERNAL: 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) voidvoidparse(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 Details
-
NAMESPACE_PREFIXES_FEATURE
- See Also:
-
REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE_FEATURE
- See Also:
-
validatingContentHandler
-
locator
-
-
Constructor Details
-
XMLReader
-
XMLReader
public XMLReader()
-
-
Method Details
-
getLocator
INTERNAL: return the Locator object associated with this reader- Since:
- 2.4
-
setLocator
INTERNAL: set the Locator object to associate with this reader- Since:
- 2.4
-
getContentHandler
- Specified by:
getContentHandlerin interfaceXMLReader
-
setContentHandler
- 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
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
- Specified by:
getDTDHandlerin interfaceXMLReader
-
setDTDHandler
- Specified by:
setDTDHandlerin interfaceXMLReader
-
setEntityResolver
- Specified by:
setEntityResolverin interfaceXMLReader
-
getEntityResolver
- Specified by:
getEntityResolverin interfaceXMLReader
-
getErrorHandler
- Specified by:
getErrorHandlerin interfaceXMLReader
-
setErrorHandler
- Specified by:
setErrorHandlerin interfaceXMLReader
-
getLexicalHandler
-
setLexicalHandler
-
getFeature
- Specified by:
getFeaturein interfaceXMLReader- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
setFeature
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException - Specified by:
setFeaturein interfaceXMLReader- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
getProperty
- Specified by:
getPropertyin interfaceXMLReader- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
setProperty
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException - Specified by:
setPropertyin interfaceXMLReader- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
parse
- Specified by:
parsein interfaceXMLReader- Throws:
IOExceptionSAXException
-
parse
- Specified by:
parsein interfaceXMLReader- Throws:
IOExceptionSAXException
-
setValidatorHandler
-
getValidatorHandler
-
newObjectEvent
-
getCurrentObject
-
getValue
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
-
isNullRecord
-
isInCollection
public boolean isInCollection()
-