Package org.eclipse.persistence.oxm
Class XMLUnmarshaller
java.lang.Object
org.eclipse.persistence.internal.oxm.Unmarshaller<ABSTRACT_SESSION,CONTEXT,DESCRIPTOR,ID_RESOLVER,MEDIA_TYPE,ROOT,UNMARSHALLER_HANDLER,UNMARSHALLER_LISTENER>
org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
org.eclipse.persistence.oxm.XMLUnmarshaller
- All Implemented Interfaces:
Cloneable
public class XMLUnmarshaller
extends org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
implements Cloneable
Class used to unmarshal XML & JSON to objects.
Create an XMLUnmarshaller from an XMLContext.
Code Sample
XMLContext context = new XMLContext("mySessionName");
XMLUnmarshaller unmarshaller = context.createUnmarshaller();
XML can be unmarshalled from the following inputs:
- java.io.File
- java.io.InputStream
- java.io.Reader
- java.net.URL
- javax.xml.transform.Source
- org.w3c.dom.Node
- org.xml.sax.InputSource
XML that can be unmarshalled is XML which has a root tag that corresponds to a default root element on an XMLDescriptor in the TopLink project associated with the XMLContext.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.persistence.internal.oxm.Unmarshaller
org.eclipse.persistence.internal.oxm.Unmarshaller.Listener
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
Fields inherited from class org.eclipse.persistence.internal.oxm.XMLUnmarshaller
platformUnmarshaller, schemasAreInitialized, xmlUnmarshallerHandler
Fields inherited from class org.eclipse.persistence.internal.oxm.Unmarshaller
context
-
Constructor Summary
ModifierConstructorDescriptionprotected
XMLUnmarshaller
(XMLContext xmlContext) protected
XMLUnmarshaller
(XMLContext xmlContext, Map<String, Boolean> parserFeatures) protected
XMLUnmarshaller
(XMLUnmarshaller xmlUnmarshaller) -
Method Summary
Modifier and TypeMethodDescriptionclone()
INTERNALorg.eclipse.persistence.internal.oxm.record.UnmarshalRecord
createUnmarshalRecord
(XMLDescriptor xmlDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNALReturn this Unmarshaller's custom IDResolver.Get the MediaType for this xmlUnmarshaller.Return the instance of XMLContext that was used to create this instance of XMLUnmarshaller.protected void
initialize
(Map<String, Boolean> parserFeatures) void
setIDResolver
(IDResolver idResolver) Set this Unmarshaller's custom IDResolver.void
setMediaType
(MediaType mediaType) Set the MediaType for this xmlUnmarshaller.void
setUnmarshalListener
(XMLUnmarshalListener listener) void
setValidationMode
(int validationMode) Set the validation mode.void
setXMLContext
(XMLContext value) Set the XMLContext used by this instance of XMLUnmarshaller.Methods inherited from class org.eclipse.persistence.internal.oxm.XMLUnmarshaller
createRootUnmarshalRecord, getAttachmentUnmarshaller, getAttributePrefix, getEntityResolver, getErrorHandler, getJsonTypeConfiguration, getNamespaceResolver, getNamespaceSeparator, getProperties, getProperty, getSchema, getStringBuffer, getUnmappedContentHandlerClass, getUnmarshalAttributeGroup, getValidationMode, getValueWrapper, isApplicationJSON, isApplicationXML, isAutoDetectMediaType, isCaseInsensitive, isIncludeRoot, isLogPayload, isResultAlwaysXMLRoot, isSecureProcessingDisabled, isWrapperAsCollectionName, setAttachmentUnmarshaller, setAttributePrefix, setAutoDetectMediaType, setCaseInsensitive, setDisableSecureProcessing, setEntityResolver, setErrorHandler, setIncludeRoot, setLogPayload, setNamespaceResolver, setNamespaceSeparator, setResultAlwaysXMLRoot, setSchema, setUnmappedContentHandlerClass, setUnmarshalAttributeGroup, setValueWrapper, setWarnOnUnmappedElement, setWrapperAsCollectionName, shouldWarnOnUnmappedElement, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal
Methods inherited from class org.eclipse.persistence.internal.oxm.Unmarshaller
getContext
-
Field Details
-
NONVALIDATING
public static final int NONVALIDATING- See Also:
-
SCHEMA_VALIDATION
public static final int SCHEMA_VALIDATION- See Also:
-
DTD_VALIDATION
public static final int DTD_VALIDATION- See Also:
-
-
Constructor Details
-
XMLUnmarshaller
-
XMLUnmarshaller
-
XMLUnmarshaller
-
-
Method Details
-
clone
- Overrides:
clone
in classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-
createRoot
INTERNAL- Overrides:
createRoot
in classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-
createUnmarshalRecord
public org.eclipse.persistence.internal.oxm.record.UnmarshalRecord createUnmarshalRecord(XMLDescriptor xmlDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL- Overrides:
createUnmarshalRecord
in classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-
getMediaType
Get the MediaType for this xmlUnmarshaller. See org.eclipse.persistence.oxm.MediaType for the media types supported by EclipseLink MOXy If not set the default is MediaType.APPLICATION_XML- Overrides:
getMediaType
in classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener> - Returns:
- MediaType
-
getUnmarshalListener
- Overrides:
getUnmarshalListener
in classorg.eclipse.persistence.internal.oxm.Unmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-
setUnmarshalListener
- Overrides:
setUnmarshalListener
in classorg.eclipse.persistence.internal.oxm.Unmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-
getUnmarshallerHandler
- Overrides:
getUnmarshallerHandler
in classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-
getXMLContext
Return the instance of XMLContext that was used to create this instance of XMLUnmarshaller.- Overrides:
getXMLContext
in classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-
setMediaType
Set the MediaType for this xmlUnmarshaller. See org.eclipse.persistence.oxm.MediaType for the media types supported by EclipseLink MOXy- Overrides:
setMediaType
in classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener> - Parameters:
mediaType
-
-
setValidationMode
public void setValidationMode(int validationMode) Set the validation mode. This method sets the validation mode of the parser to one of the 3 types: NONVALIDATING, DTD_VALIDATION and SCHEMA_VALIDATION. By default, the unmarshaller is set to be NONVALIDATING- Parameters:
validationMode
- sets the type of the validation mode to be used
-
setXMLContext
Set the XMLContext used by this instance of XMLUnmarshaller.- Overrides:
setXMLContext
in classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-
getIDResolver
Return this Unmarshaller's custom IDResolver.- Overrides:
getIDResolver
in classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener> - Returns:
- the custom IDResolver, or null if one has not been specified.
- See Also:
-
setIDResolver
Set this Unmarshaller's custom IDResolver.- Overrides:
setIDResolver
in classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener> - See Also:
-
initialize
- Overrides:
initialize
in classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-