org.ksoap2.serialization
Class MarshalHashtable

java.lang.Object
  extended by org.ksoap2.serialization.MarshalHashtable
All Implemented Interfaces:
Marshal

public class MarshalHashtable
extends java.lang.Object
implements Marshal

Serializes instances of hashtable to and from xml. This implementation is based on the xml schema from apache-soap, namely the type 'map' in the namespace 'http://xml.apache.org/xml-soap'. Other soap implementations including apache (obviously) and glue are also interoperable with the schema.


Nested Class Summary
(package private)  class MarshalHashtable.ItemSoapObject
           
 
Field Summary
(package private)  SoapSerializationEnvelope envelope
           
static java.lang.Class HASHTABLE_CLASS
          CLDC does not support .class, so this helper is needed.
static java.lang.String NAME
          use then during registration
static java.lang.String NAMESPACE
          use then during registration
 
Constructor Summary
MarshalHashtable()
           
 
Method Summary
 java.lang.Object readInstance(XmlPullParser parser, java.lang.String namespace, java.lang.String name, PropertyInfo expected)
          This methods reads an instance from the given parser.
 void register(SoapSerializationEnvelope cm)
          Register this Marshal with Envelope
 void writeInstance(XmlSerializer writer, java.lang.Object instance)
          Write the instance to the given XmlSerializer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final java.lang.String NAMESPACE
use then during registration

See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
use then during registration

See Also:
Constant Field Values

HASHTABLE_CLASS

public static final java.lang.Class HASHTABLE_CLASS
CLDC does not support .class, so this helper is needed.


envelope

SoapSerializationEnvelope envelope
Constructor Detail

MarshalHashtable

public MarshalHashtable()
Method Detail

readInstance

public java.lang.Object readInstance(XmlPullParser parser,
                                     java.lang.String namespace,
                                     java.lang.String name,
                                     PropertyInfo expected)
                              throws java.io.IOException,
                                     XmlPullParserException
Description copied from interface: Marshal
This methods reads an instance from the given parser. For implementation, please note that the start and and tag must be consumed. This is not symmetric to writeInstance, but otherwise it would not be possible to access the attributes of the start tag here.

Specified by:
readInstance in interface Marshal
Throws:
java.io.IOException
XmlPullParserException

writeInstance

public void writeInstance(XmlSerializer writer,
                          java.lang.Object instance)
                   throws java.io.IOException
Description copied from interface: Marshal
Write the instance to the given XmlSerializer. In contrast to readInstance, it is not neccessary to care about the sorrounding start and end tags. Additional attributes must be writen before anything else is written.

Specified by:
writeInstance in interface Marshal
Throws:
java.io.IOException

register

public void register(SoapSerializationEnvelope cm)
Description copied from interface: Marshal
Register this Marshal with Envelope

Specified by:
register in interface Marshal