com.echomine.xmlrpc
Class StringSerializer

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

public class StringSerializer
extends java.lang.Object
implements Serializer, Deserializer

The string serializer will work with the <string> type in the XML-RPC specs. An example string element looks like the following:

 <string>hello world<string>
 


Field Summary
static java.lang.String NAME
           
 
Constructor Summary
StringSerializer()
           
 
Method Summary
 java.lang.Object deserialize(Element elem)
          deserializes the element data into a String object.
 Element serialize(java.lang.Object data, Namespace ns)
          serializes the data into an XML element.
 
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

StringSerializer

public StringSerializer()
Method Detail

serialize

public Element serialize(java.lang.Object data,
                         Namespace ns)
serializes the data into an XML element. Note that this method will accept any object class. However, if it happens not to be of class String, then the toString() will be called.

Specified by:
serialize in interface Serializer
Parameters:
data - an object to serialize, can be any object
ns - optional namespace, null if none
Returns:
the xml element representation of the serialized data

deserialize

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

Specified by:
deserialize in interface Deserializer
Parameters:
elem - the element containing the string data
Returns:
a String object


Copyright © 2001-2005 Echomine. All Rights Reserved.