org.ksoap2.serialization
Interface Marshal

All Known Implementing Classes:
MarshalBase64, MarshalDate, MarshalFloat, MarshalHashtable

public interface Marshal

Interface for custom (de)serialization.


Method Summary
 java.lang.Object readInstance(org.xmlpull.v1.XmlPullParser parser, java.lang.String namespace, java.lang.String name, PropertyInfo expected)
          This methods reads an instance from the given parser.
 void register(SoapSerializationEnvelope envelope)
          Register this Marshal with Envelope
 void writeInstance(org.xmlpull.v1.XmlSerializer writer, java.lang.Object instance)
          Write the instance to the given XmlSerializer.
 

Method Detail

readInstance

java.lang.Object readInstance(org.xmlpull.v1.XmlPullParser parser,
                              java.lang.String namespace,
                              java.lang.String name,
                              PropertyInfo expected)
                              throws java.io.IOException,
                                     org.xmlpull.v1.XmlPullParserException
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.

Parameters:
parser - the xml parser
namespace - the namespace.
Returns:
the object read from the xml stream.
Throws:
java.io.IOException
org.xmlpull.v1.XmlPullParserException

writeInstance

void writeInstance(org.xmlpull.v1.XmlSerializer writer,
                   java.lang.Object instance)
                   throws java.io.IOException
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.

Parameters:
writer - the xml serializer.
instance - the instance to write to the writer.
Throws:
java.io.IOException

register

void register(SoapSerializationEnvelope envelope)
Register this Marshal with Envelope

Parameters:
envelope - the soap serialization envelope.