org.demac.impl.j2me.process.base.service.webservices.xml.soap.ksoap
Class ClassMap

java.lang.Object
  extended by org.demac.impl.j2me.process.base.service.webservices.xml.soap.ksoap.ClassMap

public class ClassMap
extends java.lang.Object

This class provides various soap properties relevant for (de)serialization, including a method for defining mappings between java classes and XML element names.


Field Summary
 java.lang.String enc
           
 java.lang.String env
           
 boolean implicitTypes
          Determines if type attributes are included for all objects written.
 PrefixMap prefixMap
           
 int version
           
 java.lang.String xsd
           
 java.lang.String xsi
           
 
Constructor Summary
ClassMap()
          deprecated Create a new class map using the 2001 version of the XML schema namespace.
ClassMap(boolean legacy)
          deprecated Creates a new Class map.
ClassMap(int version)
           
 
Method Summary
 void addMapping(java.lang.String namespace, java.lang.String name, java.lang.Class clazz)
          Defines a direct mapping from a namespace and name to a java class (and vice versa)
 void addMapping(java.lang.String namespace, java.lang.String name, java.lang.Class clazz, Marshal marshal)
          Defines a direct mapping from a namespace and name to a java class (and vice versa), using the given marshal mechanism
 void addTemplate(SoapObject so)
          Adds a SoapObject to the class map.
 java.lang.Object[] getInfo(java.lang.Object type, java.lang.Object instance)
          Returns a string array containing the namespace, name, id and Marshal object for the given java object.
 java.lang.Object readInstance(SoapParser parser, java.lang.String namespace, java.lang.String name, ElementType expected)
          Returns a new object read from the given parser.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

implicitTypes

public boolean implicitTypes
Determines if type attributes are included for all objects written. If true, the type attribute is only written if the actual type differs from the declared type.


version

public int version

prefixMap

public PrefixMap prefixMap

xsi

public java.lang.String xsi

xsd

public java.lang.String xsd

env

public java.lang.String env

enc

public java.lang.String enc
Constructor Detail

ClassMap

public ClassMap()
deprecated Create a new class map using the 2001 version of the XML schema namespace.


ClassMap

public ClassMap(int version)

ClassMap

public ClassMap(boolean legacy)
deprecated Creates a new Class map. If the legacy flag is set to true, the 1999 version of the XML Schema namespace is used, otherwise the 2001 version.

Method Detail

readInstance

public java.lang.Object readInstance(SoapParser parser,
                                     java.lang.String namespace,
                                     java.lang.String name,
                                     ElementType expected)
                              throws java.io.IOException
Returns a new object read from the given parser. If no mapping is found, null is returned. This method is used by the SoapParser in order to convert the XML code to Java objects.

Throws:
java.io.IOException

getInfo

public java.lang.Object[] getInfo(java.lang.Object type,
                                  java.lang.Object instance)
Returns a string array containing the namespace, name, id and Marshal object for the given java object. This method is used by the SoapWriter in order to map Java objects to the corresponding SOAP section five XML code.


addMapping

public void addMapping(java.lang.String namespace,
                       java.lang.String name,
                       java.lang.Class clazz,
                       Marshal marshal)
Defines a direct mapping from a namespace and name to a java class (and vice versa), using the given marshal mechanism


addMapping

public void addMapping(java.lang.String namespace,
                       java.lang.String name,
                       java.lang.Class clazz)
Defines a direct mapping from a namespace and name to a java class (and vice versa)


addTemplate

public void addTemplate(SoapObject so)
Adds a SoapObject to the class map. During parsing, objects of the given type (namespace/name) will be mapped to corresponding copies of the given SoapObject, maintaining the structure of the template.