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.
org.eclipse.persistence.oxm.XMLContext
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| public static final int | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public XMLUnmarshaller | clone()
Overrides org. |
| public XMLRoot | |
| public UnmarshalRecord | createUnmarshalRecord(XMLDescriptor xmlDescriptor, AbstractSession session)
Overrides org. |
| public IDResolver | Returns: the custom IDResolver, or null if one has not been specified.Overrides org. |
| public MediaType | Returns: MediaTypeOverrides org. |
| public XMLUnmarshallerHandler | |
| public XMLUnmarshalListener | |
| public XMLContext | getXMLContext()
Overrides org. |
| protected void | initialize(Map<String, Boolean> parserFeatures)
Overrides org. |
| private void | |
| public void | setIDResolver(IDResolver idResolver)
Overrides org. |
| public void | setMediaType(MediaType mediaType)
Overrides org. |
| public void | |
| public void | setValidationMode(int
sets the type of the validation mode to be used validationMode)Set the validation mode. |
| public void | setXMLContext(XMLContext value)
Overrides org. |
| DTD_VALIDATION | back to summary |
|---|---|
| public static final int DTD_VALIDATION Hides org. | |
| NONVALIDATING | back to summary |
|---|---|
| public static final int NONVALIDATING Hides org. | |
| SCHEMA_VALIDATION | back to summary |
|---|---|
| public static final int SCHEMA_VALIDATION Hides org. | |
| XMLUnmarshaller | back to summary |
|---|---|
| protected XMLUnmarshaller(XMLContext xmlContext) | |
| XMLUnmarshaller | back to summary |
|---|---|
| protected XMLUnmarshaller(XMLContext xmlContext, Map<String, Boolean> parserFeatures) | |
| XMLUnmarshaller | back to summary |
|---|---|
| protected XMLUnmarshaller(XMLUnmarshaller xmlUnmarshaller) | |
| clone | back to summary |
|---|---|
| public XMLUnmarshaller clone() Overrides org. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| createRoot | back to summary |
|---|---|
| public XMLRoot createRoot() Overrides org. INTERNAL
| |
| createUnmarshalRecord | back to summary |
|---|---|
| public UnmarshalRecord Overrides org. INTERNAL
| |
| getIDResolver | back to summary |
|---|---|
| public IDResolver getIDResolver() Overrides org. Return this Unmarshaller's custom IDResolver.
| |
| getMediaType | back to summary |
|---|---|
| public MediaType getMediaType() Overrides org. 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 | |
| getUnmarshallerHandler | back to summary |
|---|---|
| public XMLUnmarshallerHandler getUnmarshallerHandler() Overrides org.
| |
| getUnmarshalListener | back to summary |
|---|---|
| public XMLUnmarshalListener getUnmarshalListener() Overrides org.
| |
| getXMLContext | back to summary |
|---|---|
| public XMLContext getXMLContext() Overrides org. Return the instance of XMLContext that was used to create this instance of XMLUnmarshaller.
| |
| initialize | back to summary |
|---|---|
| protected void initialize(Map<String, Boolean> parserFeatures) Overrides org.
| |
| initializeSchemas | back to summary |
|---|---|
| private void initializeSchemas() | |
| setIDResolver | back to summary |
|---|---|
| public void setIDResolver(IDResolver idResolver) Overrides org. Set this Unmarshaller's custom IDResolver.
| |
| setMediaType | back to summary |
|---|---|
| public void setMediaType(MediaType mediaType) Overrides org. Set the MediaType for this xmlUnmarshaller. See org.eclipse.persistence.oxm.MediaType for the media types supported by EclipseLink MOXy
| |
| setUnmarshalListener | back to summary |
|---|---|
| public void setUnmarshalListener(XMLUnmarshalListener listener) Overrides org.
| |
| setValidationMode | back to summary |
|---|---|
| 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
| |
| setXMLContext | back to summary |
|---|---|
| public void setXMLContext(XMLContext value) Overrides org. Set the XMLContext used by this instance of XMLUnmarshaller.
| |