Skip navigation links
org.eclipse.persistence.jaxb
Class JAXBUnmarshaller
java.lang.Object
org.eclipse.persistence.jaxb.JAXBUnmarshaller
- All Implemented Interfaces:
- javax.xml.bind.Unmarshaller
-
public class JAXBUnmarshaller
- extends java.lang.Object
- implements javax.xml.bind.Unmarshaller
INTERNAL:
Purpose:To Provide an implementation of the JAXB 2.0 Unmarshaller Interface
Responsibilities:
- Provide a JAXB wrapper on the XMLUnmarshaller API
- Perform XML to Object Conversions
This implementation of the JAXB 2.0 Unmarshaller interface provides the required functionality by acting as a thin wrapper on the existing XMLMarshaller API.
- Since:
- Oracle TopLink 11.1.1.0.0
- Author:
- mmacivor
- See Also:
Unmarshaller
, XMLUnmarshaller
Nested classes/interfaces inherited from interface javax.xml.bind.Unmarshaller |
javax.xml.bind.Unmarshaller.Listener |
Method Summary |
private javax.xml.bind.JAXBElement |
buildJAXBElementFromObject(java.lang.Object obj, java.lang.Class declaredClass)
Create a JAXBElement instance. |
private javax.xml.bind.JAXBElement |
createJAXBElement(javax.xml.namespace.QName qname, java.lang.Class theClass, java.lang.Object value)
|
private javax.xml.bind.JAXBElement |
createJAXBElementFromXMLRoot(XMLRoot xmlRoot, java.lang.Class declaredType)
|
private java.lang.Object |
createJAXBElementIfRequired(java.lang.Object value)
|
javax.xml.bind.annotation.adapters.XmlAdapter |
getAdapter(java.lang.Class javaClass)
|
javax.xml.bind.attachment.AttachmentUnmarshaller |
getAttachmentUnmarshaller()
|
private java.lang.Class |
getClassToUnmarshalTo(java.lang.Class originalClass)
|
javax.xml.bind.ValidationEventHandler |
getEventHandler()
|
JAXBContext |
getJaxbContext()
|
javax.xml.bind.Unmarshaller.Listener |
getListener()
|
java.lang.Object |
getProperty(java.lang.String key)
|
javax.xml.validation.Schema |
getSchema()
|
javax.xml.bind.UnmarshallerHandler |
getUnmarshallerHandler()
|
XMLUnmarshaller |
getXMLUnmarshaller()
|
private javax.xml.bind.JAXBException |
handleXMLMarshalException(XMLMarshalException xmlMarshalException)
|
boolean |
isValidating()
|
void |
setAdapter(java.lang.Class javaClass, javax.xml.bind.annotation.adapters.XmlAdapter adapter)
|
void |
setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter adapter)
|
void |
setAttachmentUnmarshaller(javax.xml.bind.attachment.AttachmentUnmarshaller unmarshaller)
|
void |
setEventHandler(javax.xml.bind.ValidationEventHandler newValidationEventHandler)
|
void |
setJaxbContext(JAXBContext jaxbContext)
|
void |
setListener(javax.xml.bind.Unmarshaller.Listener listener)
|
void |
setProperty(java.lang.String key, java.lang.Object value)
|
void |
setSchema(javax.xml.validation.Schema schema)
|
void |
setUnmarshalCallbacks(java.util.HashMap callbacks)
|
void |
setValidating(boolean validate)
|
java.lang.Object |
unmarshal(java.io.File file)
|
java.lang.Object |
unmarshal(org.xml.sax.InputSource inputSource)
|
java.lang.Object |
unmarshal(java.io.InputStream inputStream)
|
java.lang.Object |
unmarshal(org.w3c.dom.Node node)
|
javax.xml.bind.JAXBElement |
unmarshal(org.w3c.dom.Node node, java.lang.Class javaClass)
|
java.lang.Object |
unmarshal(java.io.Reader reader)
|
java.lang.Object |
unmarshal(javax.xml.transform.Source source)
|
javax.xml.bind.JAXBElement |
unmarshal(javax.xml.transform.Source source, java.lang.Class javaClass)
|
private javax.xml.bind.JAXBElement |
unmarshal(javax.xml.transform.Source source, java.lang.Class javaClass, java.lang.Class declaredType)
|
javax.xml.bind.JAXBElement |
unmarshal(javax.xml.transform.Source source, java.lang.reflect.Type type)
|
javax.xml.bind.JAXBElement |
unmarshal(javax.xml.transform.Source source, TypeMappingInfo type)
Unmarshal the object based on the binding metadata associated with the TypeMappingInfo. |
java.lang.Object |
unmarshal(java.net.URL url)
|
java.lang.Object |
unmarshal(javax.xml.stream.XMLEventReader eventReader)
|
javax.xml.bind.JAXBElement |
unmarshal(javax.xml.stream.XMLEventReader eventReader, java.lang.Class javaClass)
|
javax.xml.bind.JAXBElement |
unmarshal(javax.xml.stream.XMLEventReader eventReader, java.lang.reflect.Type type)
|
javax.xml.bind.JAXBElement |
unmarshal(javax.xml.stream.XMLEventReader eventReader, TypeMappingInfo type)
Unmarshal the object based on the binding metadata associated with the TypeMappingInfo. |
java.lang.Object |
unmarshal(javax.xml.stream.XMLStreamReader streamReader)
|
javax.xml.bind.JAXBElement |
unmarshal(javax.xml.stream.XMLStreamReader streamReader, java.lang.Class javaClass)
|
javax.xml.bind.JAXBElement |
unmarshal(javax.xml.stream.XMLStreamReader streamReader, java.lang.reflect.Type type)
|
javax.xml.bind.JAXBElement |
unmarshal(javax.xml.stream.XMLStreamReader streamReader, TypeMappingInfo type)
Unmarshal the object based on the binding metadata associated with the TypeMappingInfo. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
validationEventHandler
private javax.xml.bind.ValidationEventHandler validationEventHandler
xmlUnmarshaller
private XMLUnmarshaller xmlUnmarshaller
jaxbContext
private JAXBContext jaxbContext
xmlInputFactory
private javax.xml.stream.XMLInputFactory xmlInputFactory
XML_JAVATYPE_ADAPTERS
public static final java.lang.String XML_JAVATYPE_ADAPTERS
-
- See Also:
- Constant Field Values
STAX_SOURCE_CLASS_NAME
public static final java.lang.String STAX_SOURCE_CLASS_NAME
-
- See Also:
- Constant Field Values
JAXBUnmarshaller
public JAXBUnmarshaller(XMLUnmarshaller newXMLUnmarshaller)
getXMLUnmarshaller
public XMLUnmarshaller getXMLUnmarshaller()
unmarshal
public java.lang.Object unmarshal(java.io.File file)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public java.lang.Object unmarshal(java.io.InputStream inputStream)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public java.lang.Object unmarshal(java.net.URL url)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public java.lang.Object unmarshal(org.xml.sax.InputSource inputSource)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public java.lang.Object unmarshal(java.io.Reader reader)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public java.lang.Object unmarshal(org.w3c.dom.Node node)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
buildJAXBElementFromObject
private javax.xml.bind.JAXBElement buildJAXBElementFromObject(java.lang.Object obj,
java.lang.Class declaredClass)
- Create a JAXBElement instance. If the object is an instance of XMLRoot, we will use its field values to create the JAXBElement. If the object is not an XMLRoot instance, we will have to determine the 'name' value. This will be done using the object's descriptor default root element - any prefix will be resolved, and a QName created.
-
- Parameters:
obj
-
- Returns:
unmarshal
public javax.xml.bind.JAXBElement unmarshal(org.w3c.dom.Node node,
java.lang.Class javaClass)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public java.lang.Object unmarshal(javax.xml.transform.Source source)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public javax.xml.bind.JAXBElement unmarshal(javax.xml.transform.Source source,
java.lang.Class javaClass)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
private javax.xml.bind.JAXBElement unmarshal(javax.xml.transform.Source source,
java.lang.Class javaClass,
java.lang.Class declaredType)
unmarshal
public javax.xml.bind.JAXBElement unmarshal(javax.xml.transform.Source source,
java.lang.reflect.Type type)
throws javax.xml.bind.JAXBException
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public javax.xml.bind.JAXBElement unmarshal(javax.xml.transform.Source source,
TypeMappingInfo type)
throws javax.xml.bind.JAXBException
- Unmarshal the object based on the binding metadata associated with the TypeMappingInfo.
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public javax.xml.bind.JAXBElement unmarshal(javax.xml.stream.XMLStreamReader streamReader,
java.lang.Class javaClass)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public javax.xml.bind.JAXBElement unmarshal(javax.xml.stream.XMLStreamReader streamReader,
java.lang.reflect.Type type)
throws javax.xml.bind.JAXBException
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public javax.xml.bind.JAXBElement unmarshal(javax.xml.stream.XMLStreamReader streamReader,
TypeMappingInfo type)
throws javax.xml.bind.JAXBException
- Unmarshal the object based on the binding metadata associated with the TypeMappingInfo.
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public java.lang.Object unmarshal(javax.xml.stream.XMLStreamReader streamReader)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public javax.xml.bind.JAXBElement unmarshal(javax.xml.stream.XMLEventReader eventReader,
java.lang.Class javaClass)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public javax.xml.bind.JAXBElement unmarshal(javax.xml.stream.XMLEventReader eventReader,
java.lang.reflect.Type type)
throws javax.xml.bind.JAXBException
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public javax.xml.bind.JAXBElement unmarshal(javax.xml.stream.XMLEventReader eventReader,
TypeMappingInfo type)
throws javax.xml.bind.JAXBException
- Unmarshal the object based on the binding metadata associated with the TypeMappingInfo.
-
- Throws:
javax.xml.bind.JAXBException
unmarshal
public java.lang.Object unmarshal(javax.xml.stream.XMLEventReader eventReader)
throws javax.xml.bind.JAXBException
-
- Specified by:
unmarshal
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
getUnmarshallerHandler
public javax.xml.bind.UnmarshallerHandler getUnmarshallerHandler()
-
- Specified by:
getUnmarshallerHandler
in interface javax.xml.bind.Unmarshaller
setValidating
public void setValidating(boolean validate)
throws javax.xml.bind.JAXBException
-
- Specified by:
setValidating
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
isValidating
public boolean isValidating()
throws javax.xml.bind.JAXBException
-
- Specified by:
isValidating
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
setEventHandler
public void setEventHandler(javax.xml.bind.ValidationEventHandler newValidationEventHandler)
throws javax.xml.bind.JAXBException
-
- Specified by:
setEventHandler
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
getEventHandler
public javax.xml.bind.ValidationEventHandler getEventHandler()
throws javax.xml.bind.JAXBException
-
- Specified by:
getEventHandler
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.JAXBException
setProperty
public void setProperty(java.lang.String key,
java.lang.Object value)
throws javax.xml.bind.PropertyException
-
- Specified by:
setProperty
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.PropertyException
getProperty
public java.lang.Object getProperty(java.lang.String key)
throws javax.xml.bind.PropertyException
-
- Specified by:
getProperty
in interface javax.xml.bind.Unmarshaller
-
- Throws:
javax.xml.bind.PropertyException
getListener
public javax.xml.bind.Unmarshaller.Listener getListener()
-
- Specified by:
getListener
in interface javax.xml.bind.Unmarshaller
setListener
public void setListener(javax.xml.bind.Unmarshaller.Listener listener)
-
- Specified by:
setListener
in interface javax.xml.bind.Unmarshaller
getAdapter
public javax.xml.bind.annotation.adapters.XmlAdapter getAdapter(java.lang.Class javaClass)
-
- Specified by:
getAdapter
in interface javax.xml.bind.Unmarshaller
setAdapter
public void setAdapter(java.lang.Class javaClass,
javax.xml.bind.annotation.adapters.XmlAdapter adapter)
-
- Specified by:
setAdapter
in interface javax.xml.bind.Unmarshaller
setAdapter
public void setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter adapter)
-
- Specified by:
setAdapter
in interface javax.xml.bind.Unmarshaller
setSchema
public void setSchema(javax.xml.validation.Schema schema)
-
- Specified by:
setSchema
in interface javax.xml.bind.Unmarshaller
getSchema
public javax.xml.validation.Schema getSchema()
-
- Specified by:
getSchema
in interface javax.xml.bind.Unmarshaller
getAttachmentUnmarshaller
public javax.xml.bind.attachment.AttachmentUnmarshaller getAttachmentUnmarshaller()
-
- Specified by:
getAttachmentUnmarshaller
in interface javax.xml.bind.Unmarshaller
setAttachmentUnmarshaller
public void setAttachmentUnmarshaller(javax.xml.bind.attachment.AttachmentUnmarshaller unmarshaller)
-
- Specified by:
setAttachmentUnmarshaller
in interface javax.xml.bind.Unmarshaller
setUnmarshalCallbacks
public void setUnmarshalCallbacks(java.util.HashMap callbacks)
createJAXBElementIfRequired
private java.lang.Object createJAXBElementIfRequired(java.lang.Object value)
createJAXBElementFromXMLRoot
private javax.xml.bind.JAXBElement createJAXBElementFromXMLRoot(XMLRoot xmlRoot,
java.lang.Class declaredType)
createJAXBElement
private javax.xml.bind.JAXBElement createJAXBElement(javax.xml.namespace.QName qname,
java.lang.Class theClass,
java.lang.Object value)
getJaxbContext
public JAXBContext getJaxbContext()
setJaxbContext
public void setJaxbContext(JAXBContext jaxbContext)
getClassToUnmarshalTo
private java.lang.Class getClassToUnmarshalTo(java.lang.Class originalClass)
handleXMLMarshalException
private javax.xml.bind.JAXBException handleXMLMarshalException(XMLMarshalException xmlMarshalException)
Skip navigation links