com.esri.arcgis.system
Class XMLSerializer

java.lang.Object
  extended by com.esri.arcgis.system.XMLSerializer
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, ISupportErrorInfo, IXMLSerializer, Serializable

public class XMLSerializer
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IXMLSerializer, ISupportErrorInfo

An XML serializer and deserializer of objects.

Remarks


XML Serialization is the process of converting an object's public properties and fields to a serial format (XML) for storage or transport. In other words, Serialization is a way of saving the state of an object into a Stream or buffer.

Use the XMLSerializer coclass when you wish to serialize and deserialize objects. The Serializer will call an instance of the private SerializeData and QI the objects for IXMLSerialize and call Serialize. Once the serialization is complete you ask the SerializeData to write the properties it holds using XMLWriter. Using XMLStream will allow you to save the objects. The Deserialization is the opposite process and uses XMLReader .

See the IXMLSerializer interface for more on getting information about serialization of objects.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:
IXMLStream, IXMLWriter, IXMLReader, Serialized Form

Constructor Summary
XMLSerializer()
          Constructs a XMLSerializer using ArcGIS Engine.
XMLSerializer(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
XMLSerializer theXMLSerializer = (XMLSerializer) obj;
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 Object loadFromString(String xML, IPropertySet environment, IXMLFlags flags)
          Loads an object from an XML string.
 Object readObject(IXMLReader pReader, IPropertySet environment, IXMLFlags flags)
          Reads an object from XML.
 Object readObjectByType(IXMLReader pReader, IPropertySet environment, IXMLFlags flags, String typeNamespace, String typeName)
          Reads an object from XML given an XML type.
 String saveToString(Object obj, IPropertySet environment, IXMLFlags flags)
          Saves an object to an XML string.
 void writeObject(IXMLWriter pWriter, IPropertySet environment, IXMLFlags flags, String elementName, String elementNamespaceURI, Object obj)
          Writes an object as XML.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

XMLSerializer

public XMLSerializer()
              throws IOException,
                     UnknownHostException
Constructs a XMLSerializer using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

XMLSerializer

public XMLSerializer(Object obj)
              throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
XMLSerializer theXMLSerializer = (XMLSerializer) obj;

Construct a XMLSerializer using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to XMLSerializer.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

writeObject

public void writeObject(IXMLWriter pWriter,
                        IPropertySet environment,
                        IXMLFlags flags,
                        String elementName,
                        String elementNamespaceURI,
                        Object obj)
                 throws IOException,
                        AutomationException
Writes an object as XML.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
writeObject in interface IXMLSerializer
Parameters:
pWriter - A reference to a com.esri.arcgis.system.IXMLWriter (in)
environment - A reference to a com.esri.arcgis.system.IPropertySet (in)
flags - A reference to a com.esri.arcgis.system.IXMLFlags (in)
elementName - The elementName (in)
elementNamespaceURI - The elementNamespaceURI (in)
obj - A reference to another Object (IUnknown) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

readObject

public Object readObject(IXMLReader pReader,
                         IPropertySet environment,
                         IXMLFlags flags)
                  throws IOException,
                         AutomationException
Reads an object from XML.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
readObject in interface IXMLSerializer
Parameters:
pReader - A reference to a com.esri.arcgis.system.IXMLReader (in)
environment - A reference to a com.esri.arcgis.system.IPropertySet (in)
flags - A reference to a com.esri.arcgis.system.IXMLFlags (in)
Returns:
A reference to another Object (IUnknown)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

loadFromString

public Object loadFromString(String xML,
                             IPropertySet environment,
                             IXMLFlags flags)
                      throws IOException,
                             AutomationException
Loads an object from an XML string.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
loadFromString in interface IXMLSerializer
Parameters:
xML - The xML (in)
environment - A reference to a com.esri.arcgis.system.IPropertySet (in)
flags - A reference to a com.esri.arcgis.system.IXMLFlags (in)
Returns:
A reference to another Object (IUnknown)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

saveToString

public String saveToString(Object obj,
                           IPropertySet environment,
                           IXMLFlags flags)
                    throws IOException,
                           AutomationException
Saves an object to an XML string.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
saveToString in interface IXMLSerializer
Parameters:
obj - A reference to another Object (IUnknown) (in)
environment - A reference to a com.esri.arcgis.system.IPropertySet (in)
flags - A reference to a com.esri.arcgis.system.IXMLFlags (in)
Returns:
The xML
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

readObjectByType

public Object readObjectByType(IXMLReader pReader,
                               IPropertySet environment,
                               IXMLFlags flags,
                               String typeNamespace,
                               String typeName)
                        throws IOException,
                               AutomationException
Reads an object from XML given an XML type.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
readObjectByType in interface IXMLSerializer
Parameters:
pReader - A reference to a com.esri.arcgis.system.IXMLReader (in)
environment - A reference to a com.esri.arcgis.system.IPropertySet (in)
flags - A reference to a com.esri.arcgis.system.IXMLFlags (in)
typeNamespace - The typeNamespace (in)
typeName - The typeName (in)
Returns:
A reference to another Object (IUnknown)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.