com.echomine.xmlrpc
Class ArraySerializer

java.lang.Object
  extended by com.echomine.xmlrpc.ArraySerializer
All Implemented Interfaces:
Deserializer, Serializer, SerializerFactoryAware

public class ArraySerializer
extends java.lang.Object
implements Serializer, Deserializer, SerializerFactoryAware

Used to serialize and deserialize the XMLRPC array xml data. Example:

 <array>
 <data>
    <value><i4>12</i4></value>
    <value><string>Egypt</string></value>
    <value><boolean>0</boolean></value>
    </data>
 </array>
 


Field Summary
static java.lang.String NAME
           
 
Constructor Summary
ArraySerializer()
           
 
Method Summary
 java.lang.Object deserialize(Element elem)
          deserializes the data element into a List object.
 Element serialize(java.lang.Object data, Namespace ns)
          Serializes the data object into an XML element.
 void setSerializerFactory(SerializerFactory factory)
          sets the serializer factory instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values
Constructor Detail

ArraySerializer

public ArraySerializer()
Method Detail

setSerializerFactory

public void setSerializerFactory(SerializerFactory factory)
sets the serializer factory instance

Specified by:
setSerializerFactory in interface SerializerFactoryAware

serialize

public Element serialize(java.lang.Object data,
                         Namespace ns)
Serializes the data object into an XML element. The data object must be of type List or one of its subclasses.

Specified by:
serialize in interface Serializer
Parameters:
data - object that implements the List interface
ns - optional namespace, null if none
Returns:
the Element object of the serialized data, null if there were any problems
Throws:
java.lang.IllegalArgumentException - if data object does not implement List

deserialize

public java.lang.Object deserialize(Element elem)
deserializes the data element into a List object.

Specified by:
deserialize in interface Deserializer
Parameters:
elem - the element data
Returns:
the deserialized List object, containing sub objects of corresponding types


Copyright © 2001-2005 Echomine. All Rights Reserved.