com.esri.arcgis.system
Interface IXMLSerializer

All Superinterfaces:
Serializable
All Known Implementing Classes:
XMLSerializer

public interface IXMLSerializer
extends Serializable

Provides access to members that control the XML serialization and deserialization of objects.

Description

The XMLSerializer interface allows you 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. The Deserialization is the opposite process and uses XMLReader.

Remarks

The IXmlSerializer interface provides five methods to use for object serialization and deserialization. The WriteObject method writes an object as XML while ReadObject method reads an object from XML. The LoadFromString method loads an object from an XML string, while SaveToString method saves an object as an XML string. The ReadObjectType method reads an object from XML given an XML type.

Product Availability

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

See Also:
IXMLStream, IXMLWriter, IXMLReader, IXMLSerialize

Method Summary
 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.
 

Method Detail

writeObject

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

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

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

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

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

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

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

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

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.

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.