java.lang.Object
org.eclipse.persistence.internal.oxm.Unmarshaller<AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
org.eclipse.persistence.internal.oxm.XMLUnmarshaller<AbstractSession,XMLContext,XMLDescriptor,IDResolver,MediaType,XMLRoot,XMLUnmarshallerHandler,XMLUnmarshalListener>
org.eclipse.persistence.oxm.XMLUnmarshaller
- All Implemented Interfaces:
Cloneable
public class XMLUnmarshaller
extends XMLUnmarshaller<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
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()
INTERNALcreateUnmarshalRecord
(XMLDescriptor xmlDescriptor, 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
-
createRoot
INTERNAL- Overrides:
createRoot
in classXMLUnmarshaller<AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener> - Since:
- 2.5.0
-
createUnmarshalRecord
INTERNAL- Overrides:
createUnmarshalRecord
in classXMLUnmarshaller<AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener> - Since:
- 2.5.0
-
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 classXMLUnmarshaller<AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener> - Returns:
- MediaType
- Since:
- 2.4
-
getUnmarshalListener
-
setUnmarshalListener
-
getUnmarshallerHandler
-
getXMLContext
Return the instance of XMLContext that was used to create this instance of XMLUnmarshaller. -
setMediaType
Set the MediaType for this xmlUnmarshaller. See org.eclipse.persistence.oxm.MediaType for the media types supported by EclipseLink MOXy- Overrides:
setMediaType
in classXMLUnmarshaller<AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener> - Since:
- 2.4
-
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. -
getIDResolver
Return this Unmarshaller's custom IDResolver.- Overrides:
getIDResolver
in classXMLUnmarshaller<AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener> - Returns:
- the custom IDResolver, or null if one has not been specified.
- Since:
- 2.3.3
- See Also:
-
setIDResolver
Set this Unmarshaller's custom IDResolver.- Overrides:
setIDResolver
in classXMLUnmarshaller<AbstractSession,
XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener> - Since:
- 2.3.3
- See Also:
-
initialize
-