com.sun.xml.bind.v2.runtime.unmarshaller

Class UnmarshallerImpl

public final class UnmarshallerImpl extends AbstractUnmarshallerImpl implements ValidationEventHandler

Default Unmarshaller implementation.

This class can be extended by the generated code to provide type-safe unmarshall methods.

Field Summary
protected JAXBContextImplcontext
Owning
UnmarshallingContextcoordinator
static StringFACTORY
Constructor Summary
UnmarshallerImpl(JAXBContextImpl context, AssociationMap assoc)
Method Summary
UnmarshalExceptioncreateUnmarshalException(SAXException e)
XmlVisitorcreateUnmarshallerHandler(InfosetScanner scanner, boolean inplace, JaxBeanInfo expectedType)
Creates and configures a new unmarshalling pipe line.
<A extends XmlAdapter> AgetAdapter(Class<A> type)
AttachmentUnmarshallergetAttachmentUnmarshaller()
<T> JaxBeanInfo<T>getBeanInfo(Class<T> clazz)
UnmarshallingContextgetContext()
ValidationEventHandlergetEventHandler()
ListenergetListener()
ObjectgetProperty(String name)
SchemagetSchema()
UnmarshallerHandlergetUnmarshallerHandler()
booleanhandleEvent(ValidationEvent event)
Default error handling behavior for Unmarshaller.
booleanhasEventHandler()
Returns true if an event handler is installed.
booleanisValidating()
static booleanneedsInterning(XMLReader reader)
<A extends XmlAdapter> voidsetAdapter(Class<A> type, A adapter)
voidsetAttachmentUnmarshaller(AttachmentUnmarshaller au)
voidsetListener(Listener listener)
voidsetProperty(String name, Object value)
voidsetSchema(Schema schema)
voidsetValidating(boolean validating)
protected Objectunmarshal(XMLReader reader, InputSource source)
protected <T> JAXBElement<T>unmarshal(XMLReader reader, InputSource source, Class<T> expectedType)
<T> JAXBElement<T>unmarshal(Source source, Class<T> expectedType)
<T> JAXBElement<T>unmarshal(Node node, Class<T> expectedType)
Objectunmarshal(Node node)
Objectunmarshal(SAXSource source)
Objectunmarshal(XMLStreamReader reader)
<T> JAXBElement<T>unmarshal(XMLStreamReader reader, Class<T> expectedType)
<T> JAXBElement<T>unmarshal(XMLEventReader reader, Class<T> expectedType)
Objectunmarshal(XMLEventReader reader)
Objectunmarshal0(Source source, JaxBeanInfo expectedType)
Objectunmarshal0(Node node, JaxBeanInfo expectedType)
Objectunmarshal0(XMLStreamReader reader, JaxBeanInfo expectedType)
Objectunmarshal0(InputStream input, JaxBeanInfo expectedType)

Field Detail

context

protected final JAXBContextImpl context
Owning JAXBContext

coordinator

public final UnmarshallingContext coordinator

FACTORY

public static final String FACTORY

Constructor Detail

UnmarshallerImpl

public UnmarshallerImpl(JAXBContextImpl context, AssociationMap assoc)

Method Detail

createUnmarshalException

UnmarshalException createUnmarshalException(SAXException e)

createUnmarshallerHandler

public final XmlVisitor createUnmarshallerHandler(InfosetScanner scanner, boolean inplace, JaxBeanInfo expectedType)
Creates and configures a new unmarshalling pipe line. Depending on the setting, we put a validator as a filter.

Returns: A component that implements both 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.

getAdapter

<A extends XmlAdapter> A getAdapter(Class<A> type)

getAttachmentUnmarshaller

AttachmentUnmarshaller getAttachmentUnmarshaller()

getBeanInfo

public <T> JaxBeanInfo<T> getBeanInfo(Class<T> clazz)

getContext

public UnmarshallingContext getContext()

getEventHandler

final ValidationEventHandler getEventHandler()

getListener

Listener getListener()

getProperty

Object getProperty(String name)

getSchema

Schema getSchema()

getUnmarshallerHandler

public UnmarshallerHandler getUnmarshallerHandler()

handleEvent

public boolean handleEvent(ValidationEvent event)
Default error handling behavior for Unmarshaller.

hasEventHandler

public final boolean hasEventHandler()
Returns true if an event handler is installed.

The default handler ignores any errors, and for that this method returns false.

isValidating

boolean isValidating()

Deprecated: since 2.0

needsInterning

public static boolean needsInterning(XMLReader reader)

setAdapter

<A extends XmlAdapter> void setAdapter(Class<A> type, A adapter)

setAttachmentUnmarshaller

void setAttachmentUnmarshaller(AttachmentUnmarshaller au)

setListener

void setListener(Listener listener)

setProperty

void setProperty(String name, Object value)

setSchema

void setSchema(Schema schema)

setValidating

void setValidating(boolean validating)

Deprecated: since 2.0

unmarshal

protected Object unmarshal(XMLReader reader, InputSource source)

unmarshal

protected <T> JAXBElement<T> unmarshal(XMLReader reader, InputSource source, Class<T> expectedType)

unmarshal

<T> JAXBElement<T> unmarshal(Source source, Class<T> expectedType)

unmarshal

<T> JAXBElement<T> unmarshal(Node node, Class<T> expectedType)

unmarshal

public final Object unmarshal(Node node)

unmarshal

final Object unmarshal(SAXSource source)

unmarshal

Object unmarshal(XMLStreamReader reader)

unmarshal

<T> JAXBElement<T> unmarshal(XMLStreamReader reader, Class<T> expectedType)

unmarshal

<T> JAXBElement<T> unmarshal(XMLEventReader reader, Class<T> expectedType)

unmarshal

Object unmarshal(XMLEventReader reader)

unmarshal0

public Object unmarshal0(Source source, JaxBeanInfo expectedType)

unmarshal0

public final Object unmarshal0(Node node, JaxBeanInfo expectedType)

unmarshal0

public Object unmarshal0(XMLStreamReader reader, JaxBeanInfo expectedType)

unmarshal0

public Object unmarshal0(InputStream input, JaxBeanInfo expectedType)