public class XMLUnmarshaller extends org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener> implements java.lang.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:
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.
XMLContext
Modifier and Type | Field and Description |
---|---|
static int |
DTD_VALIDATION |
static int |
NONVALIDATING |
static int |
SCHEMA_VALIDATION |
Modifier | Constructor and Description |
---|---|
protected |
XMLUnmarshaller(XMLContext xmlContext) |
protected |
XMLUnmarshaller(XMLContext xmlContext,
java.util.Map<java.lang.String,java.lang.Boolean> parserFeatures) |
protected |
XMLUnmarshaller(XMLUnmarshaller xmlUnmarshaller) |
Modifier and Type | Method and Description |
---|---|
XMLUnmarshaller |
clone() |
XMLRoot |
createRoot()
INTERNAL
|
org.eclipse.persistence.internal.oxm.record.UnmarshalRecord |
createUnmarshalRecord(XMLDescriptor xmlDescriptor,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL
|
IDResolver |
getIDResolver()
Return this Unmarshaller's custom IDResolver.
|
MediaType |
getMediaType()
Get the MediaType for this xmlUnmarshaller.
|
XMLUnmarshallerHandler |
getUnmarshallerHandler() |
XMLUnmarshalListener |
getUnmarshalListener() |
XMLContext |
getXMLContext()
Return the instance of XMLContext that was used to create this instance
of XMLUnmarshaller.
|
protected void |
initialize(java.util.Map<java.lang.String,java.lang.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.
|
createRootUnmarshalRecord, getAttachmentUnmarshaller, getAttributePrefix, getEntityResolver, getErrorHandler, getJsonTypeConfiguration, getNamespaceResolver, getNamespaceSeparator, getProperties, getProperty, getSchema, getStringBuffer, getUnmappedContentHandlerClass, getUnmarshalAttributeGroup, getValidationMode, getValueWrapper, isApplicationJSON, isApplicationXML, isAutoDetectMediaType, isCaseInsensitive, isIncludeRoot, isResultAlwaysXMLRoot, isSecureProcessingDisabled, isWrapperAsCollectionName, setAttachmentUnmarshaller, setAttributePrefix, setAutoDetectMediaType, setCaseInsensitive, setDisableSecureProcessing, setEntityResolver, setErrorHandler, setIncludeRoot, 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
public static final int NONVALIDATING
public static final int SCHEMA_VALIDATION
public static final int DTD_VALIDATION
protected XMLUnmarshaller(XMLContext xmlContext)
protected XMLUnmarshaller(XMLContext xmlContext, java.util.Map<java.lang.String,java.lang.Boolean> parserFeatures)
protected XMLUnmarshaller(XMLUnmarshaller xmlUnmarshaller)
public XMLUnmarshaller clone()
clone
in class org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
public XMLRoot createRoot()
createRoot
in class org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
public org.eclipse.persistence.internal.oxm.record.UnmarshalRecord createUnmarshalRecord(XMLDescriptor xmlDescriptor, org.eclipse.persistence.internal.sessions.AbstractSession session)
createUnmarshalRecord
in class org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
public MediaType getMediaType()
getMediaType
in class org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
public XMLUnmarshalListener getUnmarshalListener()
getUnmarshalListener
in class org.eclipse.persistence.internal.oxm.Unmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
public void setUnmarshalListener(XMLUnmarshalListener listener)
setUnmarshalListener
in class org.eclipse.persistence.internal.oxm.Unmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
public XMLUnmarshallerHandler getUnmarshallerHandler()
getUnmarshallerHandler
in class org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
public XMLContext getXMLContext()
getXMLContext
in class org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
public void setMediaType(MediaType mediaType)
setMediaType
in class org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
mediaType
- public void setValidationMode(int validationMode)
validationMode
- sets the type of the validation mode to be usedpublic void setXMLContext(XMLContext value)
setXMLContext
in class org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
public IDResolver getIDResolver()
getIDResolver
in class org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
IDResolver
public void setIDResolver(IDResolver idResolver)
setIDResolver
in class org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
IDResolver
protected void initialize(java.util.Map<java.lang.String,java.lang.Boolean> parserFeatures)
initialize
in class org.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>