com.echomine.xmlrpc
Class BooleanSerializer

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

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

Serializer for the XMLRPC boolean type. Example:

 <boolean>1</boolean>
 


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

BooleanSerializer

public BooleanSerializer()
Method Detail

serialize

public Element serialize(java.lang.Object data,
                         Namespace ns)
Serializes the data into a element data. This method will only accept Boolean objects.

Specified by:
serialize in interface Serializer
Parameters:
data - a Boolean instance
ns - optional namespace, null if none
Returns:
the element data representing the data

deserialize

public java.lang.Object deserialize(Element elem)
deserializes the element data into a Boolean object. If the value is "1", then the value is true. All other strings or values will return a false boolean value.

Specified by:
deserialize in interface Deserializer
Parameters:
elem - the data
Returns:
a Boolean object containing the value


Copyright © 2001-2005 Echomine. All Rights Reserved.