Class XMLUnmarshaller<ABSTRACT_SESSION extends CoreAbstractSession,​CONTEXT extends Context,​DESCRIPTOR extends Descriptor,​ID_RESOLVER extends IDResolver,​MEDIA_TYPE extends MediaType,​ROOT extends Root,​UNMARSHALLER_HANDLER extends UnmarshallerHandler,​UNMARSHALLER_LISTENER extends Unmarshaller.Listener>

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    XMLUnmarshaller

    public class XMLUnmarshaller<ABSTRACT_SESSION extends CoreAbstractSession,​CONTEXT extends Context,​DESCRIPTOR extends Descriptor,​ID_RESOLVER extends IDResolver,​MEDIA_TYPE extends MediaType,​ROOT extends Root,​UNMARSHALLER_HANDLER extends UnmarshallerHandler,​UNMARSHALLER_LISTENER extends Unmarshaller.Listener>
    extends Unmarshaller<ABSTRACT_SESSION,​CONTEXT,​DESCRIPTOR,​ID_RESOLVER,​MEDIA_TYPE,​ROOT,​UNMARSHALLER_HANDLER,​UNMARSHALLER_LISTENER>
    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:

    • 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:
    XMLContext
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      XMLUnmarshaller clone()  
      ROOT createRoot()
      INTERNAL
      UnmarshalRecord createRootUnmarshalRecord​(java.lang.Class clazz)
      INTERNAL
      UnmarshalRecord createUnmarshalRecord​(DESCRIPTOR xmlDescriptor, ABSTRACT_SESSION session)
      INTERNAL
      XMLAttachmentUnmarshaller getAttachmentUnmarshaller()  
      java.lang.String getAttributePrefix()
      Value that will be used to prefix attributes.
      org.xml.sax.EntityResolver getEntityResolver()
      Get the EntityResolver set on this XMLUnmarshaller
      org.xml.sax.ErrorHandler getErrorHandler()
      Get the ErrorHandler set on this XMLUnmarshaller
      ID_RESOLVER getIDResolver()
      Return this Unmarshaller's custom IDResolver.
      JsonTypeConfiguration getJsonTypeConfiguration()
      Returns json type configuration.
      MEDIA_TYPE getMediaType()
      Get the MediaType for this xmlUnmarshaller.
      NamespaceResolver getNamespaceResolver()
      Name of the NamespaceResolver to be used during unmarshal Ignored unmarshalling XML.
      char getNamespaceSeparator()
      Get the namespace separator used during unmarshal operations.
      java.util.Properties getProperties()
      Return a properties object for a given instance of the XMLUnmarshaller.
      java.lang.Object getProperty​(java.lang.Object key)
      Return the property for a given key, if one exists.
      javax.xml.validation.Schema getSchema()  
      StrBuffer getStringBuffer()
      INTERNAL: This is the text handler during unmarshal operations.
      java.lang.Class getUnmappedContentHandlerClass()
      Get the class that will be instantiated to handled unmapped content Class must implement the org.eclipse.persistence.oxm.unmapped.UnmappedContentHandler interface
      java.lang.Object getUnmarshalAttributeGroup()
      INTERNAL: Returns the AttributeGroup or the name of the AttributeGroup to be used to unmarshal.
      UNMARSHALLER_HANDLER getUnmarshallerHandler()  
      int getValidationMode()
      Get the validation mode set on this XMLUnmarshaller By default, the unmarshaller is set to be NONVALIDATING
      java.lang.String getValueWrapper()
      Name of the property to marshal/unmarshal as a wrapper on the text() mappings Ignored unmarshalling XML.
      CONTEXT 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)  
      boolean isApplicationJSON()
      INTERNAL
      boolean isApplicationXML()
      INTERNAL
      boolean isAutoDetectMediaType()
      Return if this XMLUnmarshaller should try to automatically determine the MediaType of the document (instead of using the MediaType set by setMediaType)
      boolean isCaseInsensitive()
      Return if this Unmarshaller should perform case insensitive unmarshalling.
      boolean isIncludeRoot()
      Determine if the @XMLRootElement should be marshalled when present.
      java.lang.Boolean isLogPayload()  
      boolean isResultAlwaysXMLRoot()  
      boolean isSecureProcessingDisabled()  
      boolean isWrapperAsCollectionName()  
      void setAttachmentUnmarshaller​(XMLAttachmentUnmarshaller atu)  
      void setAttributePrefix​(java.lang.String attributePrefix)
      Value that will be used to prefix attributes.
      void setAutoDetectMediaType​(boolean autoDetectMediaType)
      Set if this XMLUnmarshaller should try to automatically determine the MediaType of the document (instead of using the MediaType set by setMediaType)
      void setCaseInsensitive​(boolean caseInsensitive)
      Set true to make this Unmarshaller perform case insensitive unmarshalling.
      void setDisableSecureProcessing​(boolean disableSecureProcessing)  
      void setEntityResolver​(org.xml.sax.EntityResolver entityResolver)
      Set the EntityResolver on this XMLUnmarshaller
      void setErrorHandler​(org.xml.sax.ErrorHandler errorHandler)
      Set the ErrorHandler on this XMLUnmarshaller
      void setIDResolver​(ID_RESOLVER idResolver)
      Set this Unmarshaller's custom IDResolver.
      void setIncludeRoot​(boolean includeRoot)
      Determine if the @XMLRootElement should be marshalled when present.
      void setLogPayload​(java.lang.Boolean logPayload)  
      void setMediaType​(MEDIA_TYPE mediaType)
      Set the MediaType for this xmlUnmarshaller.
      void setNamespaceResolver​(NamespaceResolver namespaceResolver)
      Get the NamespaceResolver to be used during unmarshal Ignored unmarshalling XML.
      void setNamespaceSeparator​(char namespaceSeparator)
      Set the namespace separator used during unmarshal operations.
      void setResultAlwaysXMLRoot​(boolean alwaysReturnRoot)  
      void setSchema​(javax.xml.validation.Schema schema)  
      void setUnmappedContentHandlerClass​(java.lang.Class aClass)
      Set the class that will be instantiated to handled unmapped content Class must implement the org.eclipse.persistence.oxm.unmapped.UnmappedContentHandler interface
      void setUnmarshalAttributeGroup​(java.lang.Object attributeGroup)  
      void setValueWrapper​(java.lang.String valueWrapper)
      Name of the property to marshal/unmarshal as a wrapper on the text() mappings Ignored unmarshalling XML.
      void setWarnOnUnmappedElement​(boolean warnOnUnmappedElement)
      INTERNAL: Set to true if a warning exception should be generated when an unmapped element is encountered, false otherwise.
      void setWrapperAsCollectionName​(boolean wrapperAsCollectionName)  
      void setXMLContext​(CONTEXT value)
      Set the XMLContext used by this instance of XMLUnmarshaller.
      boolean shouldWarnOnUnmappedElement()
      INTERNAL: Returns true if a warning exception should be generated when an unmapped element is encountered.
      java.lang.Object unmarshal​(java.io.File file)
      PUBLIC: Read and parse the XML document from the file and map the XML data into an object.
      java.lang.Object unmarshal​(java.io.File file, java.lang.Class clazz)
      PUBLIC: Read and parse the XML document from the file and map the XML data into an object.
      java.lang.Object unmarshal​(java.io.InputStream inputStream)
      PUBLIC: Read and parse the XML document from the inputStream and map the XML data into an object.
      java.lang.Object unmarshal​(java.io.InputStream inputStream, java.lang.Class clazz)
      PUBLIC: Read and parse the XML document from the inputStream and map the XML data into an object.
      java.lang.Object unmarshal​(java.io.Reader reader)
      PUBLIC: Read and parse the XML document from the reader and map the XML data into an object.
      java.lang.Object unmarshal​(java.io.Reader reader, java.lang.Class clazz)
      PUBLIC: Read and parse the XML document from the reader and map the XML data into an object.
      java.lang.Object unmarshal​(java.net.URL url)
      PUBLIC: Read and parse the XML document from the url and map the XML data into an object.
      java.lang.Object unmarshal​(java.net.URL url, java.lang.Class clazz)
      PUBLIC: Read and parse the XML document from the url and map the XML data into an object.
      java.lang.Object unmarshal​(javax.xml.transform.Source source)
      PUBLIC: Read and parse the XML document from the source and map the XML data into an object.
      java.lang.Object unmarshal​(javax.xml.transform.Source source, java.lang.Class clazz)
      PUBLIC: Read and parse the XML document from the source and map the XML data into an object.
      java.lang.Object unmarshal​(org.w3c.dom.Node node)
      PUBLIC: Map the XML node into an object.
      java.lang.Object unmarshal​(org.w3c.dom.Node node, java.lang.Class clazz)
      PUBLIC: Map the XML node into an object.
      java.lang.Object unmarshal​(org.xml.sax.InputSource inputSource)
      PUBLIC: Read and parse the XML document from the inputSource and map the XML data into an object.
      java.lang.Object unmarshal​(org.xml.sax.InputSource inputSource, java.lang.Class clazz)
      PUBLIC: Read and parse the XML document from the inputSource and map the XML data into an object.
      java.lang.Object unmarshal​(org.xml.sax.XMLReader xmlReader, org.xml.sax.InputSource inputSource)  
      java.lang.Object unmarshal​(org.xml.sax.XMLReader xmlReader, org.xml.sax.InputSource inputSource, java.lang.Class clazz)  
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait