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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intFields inherited from class org.eclipse.persistence.internal.oxm.XMLUnmarshaller
platformUnmarshaller, schemasAreInitialized, xmlUnmarshallerHandlerFields inherited from class org.eclipse.persistence.internal.oxm.Unmarshaller
context -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedXMLUnmarshaller(XMLContext xmlContext) protectedXMLUnmarshaller(XMLContext xmlContext, Map<String, Boolean> parserFeatures) protectedXMLUnmarshaller(XMLUnmarshaller xmlUnmarshaller) -
Method Summary
Modifier and TypeMethodDescriptionclone()INTERNALorg.eclipse.persistence.internal.oxm.record.UnmarshalRecordcreateUnmarshalRecord(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 voidinitialize(Map<String, Boolean> parserFeatures) voidsetIDResolver(IDResolver idResolver) Set this Unmarshaller's custom IDResolver.voidsetMediaType(MediaType mediaType) Set the MediaType for this xmlUnmarshaller.voidsetUnmarshalListener(XMLUnmarshalListener listener) voidsetValidationMode(int validationMode) Set the validation mode.voidsetXMLContext(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, unmarshalMethods 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:
clonein classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-
createRoot
INTERNAL- Overrides:
createRootin 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:
createUnmarshalRecordin 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:
getMediaTypein classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener> - Returns:
- MediaType
-
getUnmarshalListener
- Overrides:
getUnmarshalListenerin classorg.eclipse.persistence.internal.oxm.Unmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-
setUnmarshalListener
- Overrides:
setUnmarshalListenerin classorg.eclipse.persistence.internal.oxm.Unmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-
getUnmarshallerHandler
- Overrides:
getUnmarshallerHandlerin 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:
getXMLContextin 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:
setMediaTypein 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:
setXMLContextin 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:
getIDResolverin 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:
setIDResolverin classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener> - See Also:
-
initialize
- Overrides:
initializein classorg.eclipse.persistence.internal.oxm.XMLUnmarshaller<org.eclipse.persistence.internal.sessions.AbstractSession,XMLContext, XMLDescriptor, IDResolver, MediaType, XMLRoot, XMLUnmarshallerHandler, XMLUnmarshalListener>
-