com.sun.xml.bind.v2.runtime.unmarshaller
Class UnmarshallerImpl
java.lang.Object
javax.xml.bind.helpers.AbstractUnmarshallerImpl
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl
- All Implemented Interfaces:
- Unmarshaller, ValidationEventHandler
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.
- Author:
- Kohsuke KAWAGUCHI
|
Method Summary |
UnmarshalException |
createUnmarshalException(SAXException e)
|
XmlVisitor |
createUnmarshallerHandler(InfosetScanner scanner,
boolean inplace,
JaxBeanInfo expectedType)
Creates and configures a new unmarshalling pipe line. |
|
getAdapter(Class<A> type)
|
AttachmentUnmarshaller |
getAttachmentUnmarshaller()
|
|
getBeanInfo(Class<T> clazz)
|
UnmarshallingContext |
getContext()
|
ValidationEventHandler |
getEventHandler()
|
Unmarshaller.Listener |
getListener()
|
Object |
getProperty(String name)
|
Schema |
getSchema()
|
UnmarshallerHandler |
getUnmarshallerHandler()
|
boolean |
handleEvent(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(XMLReader reader)
|
|
setAdapter(Class<A> type,
A adapter)
|
void |
setAttachmentUnmarshaller(AttachmentUnmarshaller au)
|
void |
setListener(Unmarshaller.Listener listener)
|
void |
setProperty(String name,
Object value)
|
void |
setSchema(Schema schema)
|
void |
setValidating(boolean validating)
Deprecated. since 2.0 |
Object |
unmarshal(Node node)
|
|
unmarshal(Node node,
Class<T> expectedType)
|
Object |
unmarshal(SAXSource source)
Deprecated. |
|
unmarshal(Source source,
Class<T> expectedType)
|
Object |
unmarshal(javax.xml.stream.XMLEventReader reader)
|
|
unmarshal(javax.xml.stream.XMLEventReader reader,
Class<T> expectedType)
|
protected Object |
unmarshal(XMLReader reader,
InputSource source)
|
protected
|
unmarshal(XMLReader reader,
InputSource source,
Class<T> expectedType)
|
Object |
unmarshal(javax.xml.stream.XMLStreamReader reader)
|
|
unmarshal(javax.xml.stream.XMLStreamReader reader,
Class<T> expectedType)
|
Object |
unmarshal0(InputStream input,
JaxBeanInfo expectedType)
|
Object |
unmarshal0(Node node,
JaxBeanInfo expectedType)
|
Object |
unmarshal0(Source source,
JaxBeanInfo expectedType)
|
Object |
unmarshal0(javax.xml.stream.XMLStreamReader reader,
JaxBeanInfo expectedType)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
context
protected final JAXBContextImpl context
- Owning
JAXBContext
coordinator
public final UnmarshallingContext coordinator
FACTORY
public static final String FACTORY
- See Also:
- Constant Field Values
UnmarshallerImpl
public UnmarshallerImpl(JAXBContextImpl context,
AssociationMap assoc)
getUnmarshallerHandler
public UnmarshallerHandler getUnmarshallerHandler()
- Specified by:
getUnmarshallerHandler in interface Unmarshaller
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.
needsInterning
public static boolean needsInterning(XMLReader reader)
unmarshal
protected Object unmarshal(XMLReader reader,
InputSource source)
throws JAXBException
- Specified by:
unmarshal in class AbstractUnmarshallerImpl
- Throws:
JAXBException
unmarshal
protected <T> JAXBElement<T> unmarshal(XMLReader reader,
InputSource source,
Class<T> expectedType)
throws JAXBException
- Throws:
JAXBException
unmarshal
public <T> JAXBElement<T> unmarshal(Source source,
Class<T> expectedType)
throws JAXBException
- Specified by:
unmarshal in interface Unmarshaller- Overrides:
unmarshal in class AbstractUnmarshallerImpl
- Throws:
JAXBException
unmarshal0
public Object unmarshal0(Source source,
JaxBeanInfo expectedType)
throws JAXBException
- Throws:
JAXBException
getEventHandler
public final ValidationEventHandler getEventHandler()
- Specified by:
getEventHandler in interface Unmarshaller- Overrides:
getEventHandler in class AbstractUnmarshallerImpl
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.
unmarshal
public <T> JAXBElement<T> unmarshal(Node node,
Class<T> expectedType)
throws JAXBException
- Specified by:
unmarshal in interface Unmarshaller- Overrides:
unmarshal in class AbstractUnmarshallerImpl
- Throws:
JAXBException
unmarshal
public final Object unmarshal(Node node)
throws JAXBException
- Specified by:
unmarshal in interface Unmarshaller
- Throws:
JAXBException
unmarshal
@Deprecated
public final Object unmarshal(SAXSource source)
throws JAXBException
- Deprecated.
- Throws:
JAXBException
unmarshal0
public final Object unmarshal0(Node node,
JaxBeanInfo expectedType)
throws JAXBException
- Throws:
JAXBException
unmarshal
public Object unmarshal(javax.xml.stream.XMLStreamReader reader)
throws JAXBException
- Specified by:
unmarshal in interface Unmarshaller- Overrides:
unmarshal in class AbstractUnmarshallerImpl
- Throws:
JAXBException
unmarshal
public <T> JAXBElement<T> unmarshal(javax.xml.stream.XMLStreamReader reader,
Class<T> expectedType)
throws JAXBException
- Specified by:
unmarshal in interface Unmarshaller- Overrides:
unmarshal in class AbstractUnmarshallerImpl
- Throws:
JAXBException
unmarshal0
public Object unmarshal0(javax.xml.stream.XMLStreamReader reader,
JaxBeanInfo expectedType)
throws JAXBException
- Throws:
JAXBException
unmarshal
public <T> JAXBElement<T> unmarshal(javax.xml.stream.XMLEventReader reader,
Class<T> expectedType)
throws JAXBException
- Specified by:
unmarshal in interface Unmarshaller- Overrides:
unmarshal in class AbstractUnmarshallerImpl
- Throws:
JAXBException
unmarshal
public Object unmarshal(javax.xml.stream.XMLEventReader reader)
throws JAXBException
- Specified by:
unmarshal in interface Unmarshaller- Overrides:
unmarshal in class AbstractUnmarshallerImpl
- Throws:
JAXBException
unmarshal0
public Object unmarshal0(InputStream input,
JaxBeanInfo expectedType)
throws JAXBException
- Throws:
JAXBException
getProperty
public Object getProperty(String name)
throws PropertyException
- Specified by:
getProperty in interface Unmarshaller- Overrides:
getProperty in class AbstractUnmarshallerImpl
- Throws:
PropertyException
setProperty
public void setProperty(String name,
Object value)
throws PropertyException
- Specified by:
setProperty in interface Unmarshaller- Overrides:
setProperty in class AbstractUnmarshallerImpl
- Throws:
PropertyException
setSchema
public void setSchema(Schema schema)
- Specified by:
setSchema in interface Unmarshaller- Overrides:
setSchema in class AbstractUnmarshallerImpl
getSchema
public Schema getSchema()
- Specified by:
getSchema in interface Unmarshaller- Overrides:
getSchema in class AbstractUnmarshallerImpl
getAttachmentUnmarshaller
public AttachmentUnmarshaller getAttachmentUnmarshaller()
- Specified by:
getAttachmentUnmarshaller in interface Unmarshaller- Overrides:
getAttachmentUnmarshaller in class AbstractUnmarshallerImpl
setAttachmentUnmarshaller
public void setAttachmentUnmarshaller(AttachmentUnmarshaller au)
- Specified by:
setAttachmentUnmarshaller in interface Unmarshaller- Overrides:
setAttachmentUnmarshaller in class AbstractUnmarshallerImpl
isValidating
public boolean isValidating()
- Deprecated. since 2.0
- Specified by:
isValidating in interface Unmarshaller- Overrides:
isValidating in class AbstractUnmarshallerImpl
setValidating
public void setValidating(boolean validating)
- Deprecated. since 2.0
- Specified by:
setValidating in interface Unmarshaller- Overrides:
setValidating in class AbstractUnmarshallerImpl
setAdapter
public <A extends XmlAdapter> void setAdapter(Class<A> type,
A adapter)
- Specified by:
setAdapter in interface Unmarshaller- Overrides:
setAdapter in class AbstractUnmarshallerImpl
getAdapter
public <A extends XmlAdapter> A getAdapter(Class<A> type)
- Specified by:
getAdapter in interface Unmarshaller- Overrides:
getAdapter in class AbstractUnmarshallerImpl
createUnmarshalException
public UnmarshalException createUnmarshalException(SAXException e)
- Overrides:
createUnmarshalException in class AbstractUnmarshallerImpl
handleEvent
public boolean handleEvent(ValidationEvent event)
- Default error handling behavior for
Unmarshaller.
- Specified by:
handleEvent in interface ValidationEventHandler
getBeanInfo
public <T> JaxBeanInfo<T> getBeanInfo(Class<T> clazz)
throws JAXBException
- Throws:
JAXBException
getListener
public Unmarshaller.Listener getListener()
- Specified by:
getListener in interface Unmarshaller- Overrides:
getListener in class AbstractUnmarshallerImpl
setListener
public void setListener(Unmarshaller.Listener listener)
- Specified by:
setListener in interface Unmarshaller- Overrides:
setListener in class AbstractUnmarshallerImpl
getContext
public UnmarshallingContext getContext()
Copyright © 2005-2011 Oracle Corporation. All Rights Reserved.