Package 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 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.1/2.2 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
,UnmarshallerProperties
,XMLUnmarshaller
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface javax.xml.bind.Unmarshaller
javax.xml.bind.Unmarshaller.Listener
-
-
Field Summary
Fields Modifier and Type Field Description static String
STAX_SOURCE_CLASS_NAME
static String
XML_JAVATYPE_ADAPTERS
-
Constructor Summary
Constructors Constructor Description JAXBUnmarshaller(XMLUnmarshaller newXMLUnmarshaller, JAXBContext jaxbContext)
-
Method Summary
-
-
-
Field Detail
-
XML_JAVATYPE_ADAPTERS
public static final String XML_JAVATYPE_ADAPTERS
- See Also:
- Constant Field Values
-
STAX_SOURCE_CLASS_NAME
public static final String STAX_SOURCE_CLASS_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JAXBUnmarshaller
public JAXBUnmarshaller(XMLUnmarshaller newXMLUnmarshaller, JAXBContext jaxbContext)
-
-
Method Detail
-
getXMLUnmarshaller
public XMLUnmarshaller getXMLUnmarshaller()
-
unmarshal
public Object unmarshal(File file) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public Object unmarshal(InputStream inputStream) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public Object unmarshal(URL url) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public Object unmarshal(InputSource inputSource) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public Object unmarshal(Reader reader) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public Object unmarshal(Node node) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public javax.xml.bind.JAXBElement unmarshal(Node node, Class javaClass) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public Object unmarshal(Source source) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public javax.xml.bind.JAXBElement unmarshal(Source source, Class javaClass) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public javax.xml.bind.JAXBElement unmarshal(Source source, Type type) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public javax.xml.bind.JAXBElement unmarshal(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(XMLStreamReader streamReader, Class javaClass) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public javax.xml.bind.JAXBElement unmarshal(XMLStreamReader streamReader, Type type) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public javax.xml.bind.JAXBElement unmarshal(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 Object unmarshal(XMLStreamReader streamReader) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public javax.xml.bind.JAXBElement unmarshal(XMLEventReader eventReader, Class javaClass) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public javax.xml.bind.JAXBElement unmarshal(XMLEventReader eventReader, Type type) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public javax.xml.bind.JAXBElement unmarshal(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 Object unmarshal(XMLEventReader eventReader) throws javax.xml.bind.JAXBException
- Specified by:
unmarshal
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
getUnmarshallerHandler
public javax.xml.bind.UnmarshallerHandler getUnmarshallerHandler()
- Specified by:
getUnmarshallerHandler
in interfacejavax.xml.bind.Unmarshaller
-
setValidating
public void setValidating(boolean validate) throws javax.xml.bind.JAXBException
- Specified by:
setValidating
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
isValidating
public boolean isValidating() throws javax.xml.bind.JAXBException
- Specified by:
isValidating
in interfacejavax.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 interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
getEventHandler
public javax.xml.bind.ValidationEventHandler getEventHandler() throws javax.xml.bind.JAXBException
- Specified by:
getEventHandler
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
setProperty
public void setProperty(String key, Object value) throws javax.xml.bind.PropertyException
Set a property on the JAXBUnmarshaller. Attempting to set any unsupported property will result in a javax.xml.bind.PropertyException.- Specified by:
setProperty
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.PropertyException
- See Also:
UnmarshallerProperties
-
getProperty
public Object getProperty(String key) throws javax.xml.bind.PropertyException
Get a property from the JAXBMarshaller. Attempting to get any unsupported property will result in a javax.xml.bind.PropertyException See Supported Properties.- Specified by:
getProperty
in interfacejavax.xml.bind.Unmarshaller
- Throws:
javax.xml.bind.PropertyException
- See Also:
UnmarshallerProperties
-
getListener
public javax.xml.bind.Unmarshaller.Listener getListener()
- Specified by:
getListener
in interfacejavax.xml.bind.Unmarshaller
-
setListener
public void setListener(javax.xml.bind.Unmarshaller.Listener listener)
- Specified by:
setListener
in interfacejavax.xml.bind.Unmarshaller
-
getAdapter
public javax.xml.bind.annotation.adapters.XmlAdapter getAdapter(Class javaClass)
- Specified by:
getAdapter
in interfacejavax.xml.bind.Unmarshaller
-
setAdapter
public void setAdapter(Class javaClass, javax.xml.bind.annotation.adapters.XmlAdapter adapter)
- Specified by:
setAdapter
in interfacejavax.xml.bind.Unmarshaller
-
setAdapter
public void setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter adapter)
- Specified by:
setAdapter
in interfacejavax.xml.bind.Unmarshaller
-
setSchema
public void setSchema(Schema schema)
- Specified by:
setSchema
in interfacejavax.xml.bind.Unmarshaller
-
getSchema
public Schema getSchema()
- Specified by:
getSchema
in interfacejavax.xml.bind.Unmarshaller
-
getAttachmentUnmarshaller
public javax.xml.bind.attachment.AttachmentUnmarshaller getAttachmentUnmarshaller()
- Specified by:
getAttachmentUnmarshaller
in interfacejavax.xml.bind.Unmarshaller
-
setAttachmentUnmarshaller
public void setAttachmentUnmarshaller(javax.xml.bind.attachment.AttachmentUnmarshaller unmarshaller)
- Specified by:
setAttachmentUnmarshaller
in interfacejavax.xml.bind.Unmarshaller
-
setUnmarshalCallbacks
public void setUnmarshalCallbacks(Map callbacks)
-
getJaxbContext
public JAXBContext getJaxbContext()
-
getIDResolver
public IDResolver getIDResolver()
Return this Unmarshaller's custom IDResolver.- Returns:
- the custom IDResolver, or null if one has not been specified.
- Since:
- 2.3.3
- See Also:
IDResolver
-
setIDResolver
public void setIDResolver(IDResolver idResolver)
Set this Unmarshaller's custom IDResolver.- Since:
- 2.3.3
- See Also:
IDResolver
-
getConstraintViolations
public Set<ConstraintViolationWrapper<Object>> getConstraintViolations()
Returns constraint violations stored in the underlyingJAXBBeanValidator
instance.- Returns:
- set of constraint violations from last unmarshal
-
-