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 java.lang.Object implements javax.xml.bind.UnmarshallerINTERNAL: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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSTAX_SOURCE_CLASS_NAMEstatic java.lang.StringXML_JAVATYPE_ADAPTERS
-
Constructor Summary
Constructors Constructor Description JAXBUnmarshaller(org.eclipse.persistence.oxm.XMLUnmarshaller newXMLUnmarshaller, JAXBContext jaxbContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.xml.bind.annotation.adapters.XmlAdaptergetAdapter(java.lang.Class javaClass)javax.xml.bind.attachment.AttachmentUnmarshallergetAttachmentUnmarshaller()java.util.Set<ConstraintViolationWrapper<java.lang.Object>>getConstraintViolations()Returns constraint violations stored in the underlyingJAXBBeanValidatorinstance.javax.xml.bind.ValidationEventHandlergetEventHandler()org.eclipse.persistence.oxm.IDResolvergetIDResolver()Return this Unmarshaller's custom IDResolver.JAXBContextgetJaxbContext()javax.xml.bind.Unmarshaller.ListenergetListener()java.lang.ObjectgetProperty(java.lang.String key)Get a property from the JAXBMarshaller.javax.xml.validation.SchemagetSchema()javax.xml.bind.UnmarshallerHandlergetUnmarshallerHandler()org.eclipse.persistence.oxm.XMLUnmarshallergetXMLUnmarshaller()booleanisValidating()voidsetAdapter(java.lang.Class javaClass, javax.xml.bind.annotation.adapters.XmlAdapter adapter)voidsetAdapter(javax.xml.bind.annotation.adapters.XmlAdapter adapter)voidsetAttachmentUnmarshaller(javax.xml.bind.attachment.AttachmentUnmarshaller unmarshaller)voidsetEventHandler(javax.xml.bind.ValidationEventHandler newValidationEventHandler)voidsetIDResolver(org.eclipse.persistence.oxm.IDResolver idResolver)Set this Unmarshaller's custom IDResolver.voidsetListener(javax.xml.bind.Unmarshaller.Listener listener)voidsetProperty(java.lang.String key, java.lang.Object value)Set a property on the JAXBUnmarshaller.voidsetSchema(javax.xml.validation.Schema schema)voidsetUnmarshalCallbacks(java.util.Map callbacks)voidsetValidating(boolean validate)java.lang.Objectunmarshal(java.io.File file)java.lang.Objectunmarshal(java.io.InputStream inputStream)java.lang.Objectunmarshal(java.io.Reader reader)java.lang.Objectunmarshal(java.net.URL url)java.lang.Objectunmarshal(javax.xml.stream.XMLEventReader eventReader)javax.xml.bind.JAXBElementunmarshal(javax.xml.stream.XMLEventReader eventReader, java.lang.Class javaClass)javax.xml.bind.JAXBElementunmarshal(javax.xml.stream.XMLEventReader eventReader, java.lang.reflect.Type type)javax.xml.bind.JAXBElementunmarshal(javax.xml.stream.XMLEventReader eventReader, TypeMappingInfo type)Unmarshal the object based on the binding metadata associated with the TypeMappingInfo.java.lang.Objectunmarshal(javax.xml.stream.XMLStreamReader streamReader)javax.xml.bind.JAXBElementunmarshal(javax.xml.stream.XMLStreamReader streamReader, java.lang.Class javaClass)javax.xml.bind.JAXBElementunmarshal(javax.xml.stream.XMLStreamReader streamReader, java.lang.reflect.Type type)javax.xml.bind.JAXBElementunmarshal(javax.xml.stream.XMLStreamReader streamReader, TypeMappingInfo type)Unmarshal the object based on the binding metadata associated with the TypeMappingInfo.java.lang.Objectunmarshal(javax.xml.transform.Source source)javax.xml.bind.JAXBElementunmarshal(javax.xml.transform.Source source, java.lang.Class javaClass)javax.xml.bind.JAXBElementunmarshal(javax.xml.transform.Source source, java.lang.reflect.Type type)javax.xml.bind.JAXBElementunmarshal(javax.xml.transform.Source source, TypeMappingInfo type)Unmarshal the object based on the binding metadata associated with the TypeMappingInfo.java.lang.Objectunmarshal(org.w3c.dom.Node node)javax.xml.bind.JAXBElementunmarshal(org.w3c.dom.Node node, java.lang.Class javaClass)java.lang.Objectunmarshal(org.xml.sax.InputSource inputSource)
-
-
-
Field Detail
-
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
-
-
Constructor Detail
-
JAXBUnmarshaller
public JAXBUnmarshaller(org.eclipse.persistence.oxm.XMLUnmarshaller newXMLUnmarshaller, JAXBContext jaxbContext)
-
-
Method Detail
-
getXMLUnmarshaller
public org.eclipse.persistence.oxm.XMLUnmarshaller getXMLUnmarshaller()
-
unmarshal
public java.lang.Object unmarshal(java.io.File file) throws javax.xml.bind.JAXBException- Specified by:
unmarshalin interfacejavax.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:
unmarshalin interfacejavax.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:
unmarshalin interfacejavax.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:
unmarshalin interfacejavax.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:
unmarshalin interfacejavax.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:
unmarshalin interfacejavax.xml.bind.Unmarshaller- Throws:
javax.xml.bind.JAXBException
-
unmarshal
public javax.xml.bind.JAXBElement unmarshal(org.w3c.dom.Node node, java.lang.Class javaClass) throws javax.xml.bind.JAXBException- Specified by:
unmarshalin interfacejavax.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:
unmarshalin interfacejavax.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:
unmarshalin interfacejavax.xml.bind.Unmarshaller- Throws:
javax.xml.bind.JAXBException
-
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.JAXBExceptionUnmarshal 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:
unmarshalin interfacejavax.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.JAXBExceptionUnmarshal 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:
unmarshalin interfacejavax.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:
unmarshalin interfacejavax.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.JAXBExceptionUnmarshal 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:
unmarshalin interfacejavax.xml.bind.Unmarshaller- Throws:
javax.xml.bind.JAXBException
-
getUnmarshallerHandler
public javax.xml.bind.UnmarshallerHandler getUnmarshallerHandler()
- Specified by:
getUnmarshallerHandlerin interfacejavax.xml.bind.Unmarshaller
-
setValidating
public void setValidating(boolean validate) throws javax.xml.bind.JAXBException- Specified by:
setValidatingin interfacejavax.xml.bind.Unmarshaller- Throws:
javax.xml.bind.JAXBException
-
isValidating
public boolean isValidating() throws javax.xml.bind.JAXBException- Specified by:
isValidatingin 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:
setEventHandlerin interfacejavax.xml.bind.Unmarshaller- Throws:
javax.xml.bind.JAXBException
-
getEventHandler
public javax.xml.bind.ValidationEventHandler getEventHandler() throws javax.xml.bind.JAXBException- Specified by:
getEventHandlerin interfacejavax.xml.bind.Unmarshaller- Throws:
javax.xml.bind.JAXBException
-
setProperty
public void setProperty(java.lang.String key, java.lang.Object value) throws javax.xml.bind.PropertyExceptionSet a property on the JAXBUnmarshaller. Attempting to set any unsupported property will result in a javax.xml.bind.PropertyException.- Specified by:
setPropertyin interfacejavax.xml.bind.Unmarshaller- Throws:
javax.xml.bind.PropertyException- See Also:
UnmarshallerProperties
-
getProperty
public java.lang.Object getProperty(java.lang.String key) throws javax.xml.bind.PropertyExceptionGet a property from the JAXBMarshaller. Attempting to get any unsupported property will result in a javax.xml.bind.PropertyException See Supported Properties.- Specified by:
getPropertyin interfacejavax.xml.bind.Unmarshaller- Throws:
javax.xml.bind.PropertyException- See Also:
UnmarshallerProperties
-
getListener
public javax.xml.bind.Unmarshaller.Listener getListener()
- Specified by:
getListenerin interfacejavax.xml.bind.Unmarshaller
-
setListener
public void setListener(javax.xml.bind.Unmarshaller.Listener listener)
- Specified by:
setListenerin interfacejavax.xml.bind.Unmarshaller
-
getAdapter
public javax.xml.bind.annotation.adapters.XmlAdapter getAdapter(java.lang.Class javaClass)
- Specified by:
getAdapterin interfacejavax.xml.bind.Unmarshaller
-
setAdapter
public void setAdapter(java.lang.Class javaClass, javax.xml.bind.annotation.adapters.XmlAdapter adapter)- Specified by:
setAdapterin interfacejavax.xml.bind.Unmarshaller
-
setAdapter
public void setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter adapter)
- Specified by:
setAdapterin interfacejavax.xml.bind.Unmarshaller
-
setSchema
public void setSchema(javax.xml.validation.Schema schema)
- Specified by:
setSchemain interfacejavax.xml.bind.Unmarshaller
-
getSchema
public javax.xml.validation.Schema getSchema()
- Specified by:
getSchemain interfacejavax.xml.bind.Unmarshaller
-
getAttachmentUnmarshaller
public javax.xml.bind.attachment.AttachmentUnmarshaller getAttachmentUnmarshaller()
- Specified by:
getAttachmentUnmarshallerin interfacejavax.xml.bind.Unmarshaller
-
setAttachmentUnmarshaller
public void setAttachmentUnmarshaller(javax.xml.bind.attachment.AttachmentUnmarshaller unmarshaller)
- Specified by:
setAttachmentUnmarshallerin interfacejavax.xml.bind.Unmarshaller
-
setUnmarshalCallbacks
public void setUnmarshalCallbacks(java.util.Map callbacks)
-
getJaxbContext
public JAXBContext getJaxbContext()
-
getIDResolver
public org.eclipse.persistence.oxm.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(org.eclipse.persistence.oxm.IDResolver idResolver)
Set this Unmarshaller's custom IDResolver.- Since:
- 2.3.3
- See Also:
IDResolver
-
getConstraintViolations
public java.util.Set<ConstraintViolationWrapper<java.lang.Object>> getConstraintViolations()
Returns constraint violations stored in the underlyingJAXBBeanValidatorinstance.- Returns:
- set of constraint violations from last unmarshal
-
-