java.io.Closeable, java.lang.AutoCloseable, javax.xml.bind.ValidationEventHandlerpublic final class UnmarshallerImpl
extends javax.xml.bind.helpers.AbstractUnmarshallerImpl
implements javax.xml.bind.ValidationEventHandler, java.io.Closeable
This class can be extended by the generated code to provide type-safe unmarshall methods.
| Modifier and Type | Field | Description |
|---|---|---|
protected JAXBContextImpl |
context |
Owning
JAXBContext |
UnmarshallingContext |
coordinator |
|
static java.lang.String |
FACTORY |
| Constructor | Description |
|---|---|
UnmarshallerImpl(JAXBContextImpl context,
AssociationMap assoc) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Must be called from same thread which created the UnmarshallerImpl instance.
|
javax.xml.bind.UnmarshalException |
createUnmarshalException(org.xml.sax.SAXException e) |
|
XmlVisitor |
createUnmarshallerHandler(InfosetScanner scanner,
boolean inplace,
JaxBeanInfo expectedType) |
Creates and configures a new unmarshalling pipe line.
|
protected void |
finalize() |
|
<A extends javax.xml.bind.annotation.adapters.XmlAdapter> |
getAdapter(java.lang.Class<A> type) |
|
javax.xml.bind.attachment.AttachmentUnmarshaller |
getAttachmentUnmarshaller() |
|
<T> JaxBeanInfo<T> |
getBeanInfo(java.lang.Class<T> clazz) |
|
UnmarshallingContext |
getContext() |
|
javax.xml.bind.ValidationEventHandler |
getEventHandler() |
|
javax.xml.bind.Unmarshaller.Listener |
getListener() |
|
java.lang.Object |
getProperty(java.lang.String name) |
|
javax.xml.validation.Schema |
getSchema() |
|
javax.xml.bind.UnmarshallerHandler |
getUnmarshallerHandler() |
|
protected org.xml.sax.XMLReader |
getXMLReader() |
Obtains a configured XMLReader.
|
boolean |
handleEvent(javax.xml.bind.ValidationEvent event) |
Default error handling behavior for
Unmarshaller. |
boolean |
hasEventHandler() |
Returns true if an event handler is installed.
|
boolean |
isValidating() |
Deprecated.
since 2.0
|
static boolean |
needsInterning(org.xml.sax.XMLReader reader) |
|
<A extends javax.xml.bind.annotation.adapters.XmlAdapter> |
setAdapter(java.lang.Class<A> type,
A adapter) |
|
void |
setAttachmentUnmarshaller(javax.xml.bind.attachment.AttachmentUnmarshaller au) |
|
void |
setListener(javax.xml.bind.Unmarshaller.Listener listener) |
|
void |
setProperty(java.lang.String name,
java.lang.Object value) |
|
void |
setSchema(javax.xml.validation.Schema schema) |
|
void |
setValidating(boolean validating) |
Deprecated.
since 2.0
|
java.lang.Object |
unmarshal(javax.xml.stream.XMLEventReader reader) |
|
<T> javax.xml.bind.JAXBElement<T> |
unmarshal(javax.xml.stream.XMLEventReader reader,
java.lang.Class<T> expectedType) |
|
java.lang.Object |
unmarshal(javax.xml.stream.XMLStreamReader reader) |
|
<T> javax.xml.bind.JAXBElement<T> |
unmarshal(javax.xml.stream.XMLStreamReader reader,
java.lang.Class<T> expectedType) |
|
java.lang.Object |
unmarshal(javax.xml.transform.sax.SAXSource source) |
Deprecated.
|
<T> javax.xml.bind.JAXBElement<T> |
unmarshal(javax.xml.transform.Source source,
java.lang.Class<T> expectedType) |
|
java.lang.Object |
unmarshal(org.w3c.dom.Node node) |
|
<T> javax.xml.bind.JAXBElement<T> |
unmarshal(org.w3c.dom.Node node,
java.lang.Class<T> expectedType) |
|
protected java.lang.Object |
unmarshal(org.xml.sax.XMLReader reader,
org.xml.sax.InputSource source) |
|
protected <T> javax.xml.bind.JAXBElement<T> |
unmarshal(org.xml.sax.XMLReader reader,
org.xml.sax.InputSource source,
java.lang.Class<T> expectedType) |
|
java.lang.Object |
unmarshal0(java.io.InputStream input,
JaxBeanInfo expectedType) |
|
java.lang.Object |
unmarshal0(javax.xml.stream.XMLStreamReader reader,
JaxBeanInfo expectedType) |
|
java.lang.Object |
unmarshal0(javax.xml.transform.Source source,
JaxBeanInfo expectedType) |
|
java.lang.Object |
unmarshal0(org.w3c.dom.Node node,
JaxBeanInfo expectedType) |
protected final JAXBContextImpl context
JAXBContextpublic final UnmarshallingContext coordinator
public static final java.lang.String FACTORY
public UnmarshallerImpl(JAXBContextImpl context, AssociationMap assoc)
public javax.xml.bind.UnmarshallerHandler getUnmarshallerHandler()
protected org.xml.sax.XMLReader getXMLReader()
throws javax.xml.bind.JAXBException
SAXSource object doesn't have XMLReader.
Unmarshaller is not re-entrant, so we will
only use one instance of XMLReader.
Overriden in order to fix potential security issue.getXMLReader in class javax.xml.bind.helpers.AbstractUnmarshallerImpljavax.xml.bind.JAXBExceptionpublic final XmlVisitor createUnmarshallerHandler(InfosetScanner scanner, boolean inplace, JaxBeanInfo expectedType)
UnmarshallerHandler
and ValidationEventHandler. All the parsing errors
should be reported to this error handler for the unmarshalling
process to work correctly.
Also, returned handler expects all the XML names to be interned.public static boolean needsInterning(org.xml.sax.XMLReader reader)
protected java.lang.Object unmarshal(org.xml.sax.XMLReader reader,
org.xml.sax.InputSource source)
throws javax.xml.bind.JAXBException
unmarshal in class javax.xml.bind.helpers.AbstractUnmarshallerImpljavax.xml.bind.JAXBExceptionprotected <T> javax.xml.bind.JAXBElement<T> unmarshal(org.xml.sax.XMLReader reader,
org.xml.sax.InputSource source,
java.lang.Class<T> expectedType)
throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBExceptionpublic <T> javax.xml.bind.JAXBElement<T> unmarshal(javax.xml.transform.Source source,
java.lang.Class<T> expectedType)
throws javax.xml.bind.JAXBException
unmarshal in class javax.xml.bind.helpers.AbstractUnmarshallerImpljavax.xml.bind.JAXBExceptionpublic java.lang.Object unmarshal0(javax.xml.transform.Source source,
JaxBeanInfo expectedType)
throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBExceptionpublic final javax.xml.bind.ValidationEventHandler getEventHandler()
getEventHandler in class javax.xml.bind.helpers.AbstractUnmarshallerImplpublic final boolean hasEventHandler()
The default handler ignores any errors, and for that this method returns false.
public <T> javax.xml.bind.JAXBElement<T> unmarshal(org.w3c.dom.Node node,
java.lang.Class<T> expectedType)
throws javax.xml.bind.JAXBException
unmarshal in class javax.xml.bind.helpers.AbstractUnmarshallerImpljavax.xml.bind.JAXBExceptionpublic final java.lang.Object unmarshal(org.w3c.dom.Node node)
throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException@Deprecated
public final java.lang.Object unmarshal(javax.xml.transform.sax.SAXSource source)
throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBExceptionpublic final java.lang.Object unmarshal0(org.w3c.dom.Node node,
JaxBeanInfo expectedType)
throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBExceptionpublic java.lang.Object unmarshal(javax.xml.stream.XMLStreamReader reader)
throws javax.xml.bind.JAXBException
unmarshal in class javax.xml.bind.helpers.AbstractUnmarshallerImpljavax.xml.bind.JAXBExceptionpublic <T> javax.xml.bind.JAXBElement<T> unmarshal(javax.xml.stream.XMLStreamReader reader,
java.lang.Class<T> expectedType)
throws javax.xml.bind.JAXBException
unmarshal in class javax.xml.bind.helpers.AbstractUnmarshallerImpljavax.xml.bind.JAXBExceptionpublic java.lang.Object unmarshal0(javax.xml.stream.XMLStreamReader reader,
JaxBeanInfo expectedType)
throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBExceptionpublic <T> javax.xml.bind.JAXBElement<T> unmarshal(javax.xml.stream.XMLEventReader reader,
java.lang.Class<T> expectedType)
throws javax.xml.bind.JAXBException
unmarshal in class javax.xml.bind.helpers.AbstractUnmarshallerImpljavax.xml.bind.JAXBExceptionpublic java.lang.Object unmarshal(javax.xml.stream.XMLEventReader reader)
throws javax.xml.bind.JAXBException
unmarshal in class javax.xml.bind.helpers.AbstractUnmarshallerImpljavax.xml.bind.JAXBExceptionpublic java.lang.Object unmarshal0(java.io.InputStream input,
JaxBeanInfo expectedType)
throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBExceptionpublic java.lang.Object getProperty(java.lang.String name)
throws javax.xml.bind.PropertyException
getProperty in class javax.xml.bind.helpers.AbstractUnmarshallerImpljavax.xml.bind.PropertyExceptionpublic void setProperty(java.lang.String name,
java.lang.Object value)
throws javax.xml.bind.PropertyException
setProperty in class javax.xml.bind.helpers.AbstractUnmarshallerImpljavax.xml.bind.PropertyExceptionpublic void setSchema(javax.xml.validation.Schema schema)
setSchema in class javax.xml.bind.helpers.AbstractUnmarshallerImplpublic javax.xml.validation.Schema getSchema()
getSchema in class javax.xml.bind.helpers.AbstractUnmarshallerImplpublic javax.xml.bind.attachment.AttachmentUnmarshaller getAttachmentUnmarshaller()
getAttachmentUnmarshaller in class javax.xml.bind.helpers.AbstractUnmarshallerImplpublic void setAttachmentUnmarshaller(javax.xml.bind.attachment.AttachmentUnmarshaller au)
setAttachmentUnmarshaller in class javax.xml.bind.helpers.AbstractUnmarshallerImplpublic boolean isValidating()
isValidating in class javax.xml.bind.helpers.AbstractUnmarshallerImplpublic void setValidating(boolean validating)
setValidating in class javax.xml.bind.helpers.AbstractUnmarshallerImplpublic <A extends javax.xml.bind.annotation.adapters.XmlAdapter> void setAdapter(java.lang.Class<A> type,
A adapter)
setAdapter in class javax.xml.bind.helpers.AbstractUnmarshallerImplpublic <A extends javax.xml.bind.annotation.adapters.XmlAdapter> A getAdapter(java.lang.Class<A> type)
getAdapter in class javax.xml.bind.helpers.AbstractUnmarshallerImplpublic javax.xml.bind.UnmarshalException createUnmarshalException(org.xml.sax.SAXException e)
createUnmarshalException in class javax.xml.bind.helpers.AbstractUnmarshallerImplpublic boolean handleEvent(javax.xml.bind.ValidationEvent event)
Unmarshaller.handleEvent in interface javax.xml.bind.ValidationEventHandlerpublic <T> JaxBeanInfo<T> getBeanInfo(java.lang.Class<T> clazz) throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBExceptionpublic javax.xml.bind.Unmarshaller.Listener getListener()
getListener in class javax.xml.bind.helpers.AbstractUnmarshallerImplpublic void setListener(javax.xml.bind.Unmarshaller.Listener listener)
setListener in class javax.xml.bind.helpers.AbstractUnmarshallerImplpublic UnmarshallingContext getContext()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionCopyright © 2017 Oracle Corporation. All rights reserved.