com.wingfoot.soap.encoding
Class TypeMappingRegistry

java.lang.Object
  |
  +--com.wingfoot.soap.encoding.TypeMappingRegistry

public class TypeMappingRegistry
extends java.lang.Object

Stores association between a Class and its namespace, localpart, serialization class and deserialization class. This is used for serialization.

Since:
0.90

Constructor Summary
TypeMappingRegistry()
           
 
Method Summary
 java.lang.String[] getClassForElement(java.lang.String elementName)
          Given an element name, determines the proper class for the contents of the elements to be deserialized to.
 java.lang.String[] getInfoForClass(java.lang.String className)
          Returns an array of String (String[]) with information for the class.
 java.lang.String[] getInfoForNamespace(java.lang.String namespace, java.lang.String localPart)
          Given an namespace and localpart, returns information that is useful in deserialization of a parameter.
 void mapElements(java.lang.String elementName, java.lang.Class classOfObject, java.lang.Class deserializerClass)
          Maps an element name to the class the element body is to be deserialized to.
 void mapTypes(java.lang.String nameSpace, java.lang.String localPart, java.lang.Class classOfObject, java.lang.Class serializerClass, java.lang.Class deserializerClass)
          Maps a Class to its serializer/deserializer class and the URI and namespace it is mapped to on the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeMappingRegistry

public TypeMappingRegistry()
Method Detail

mapTypes

public void mapTypes(java.lang.String nameSpace,
                     java.lang.String localPart,
                     java.lang.Class classOfObject,
                     java.lang.Class serializerClass,
                     java.lang.Class deserializerClass)
Maps a Class to its serializer/deserializer class and the URI and namespace it is mapped to on the server. The nameSpace and localPart should be identical to what is defined in the server deployment descriptor. This method provides means for a user to define their own custom serializers/deserializers.
Parameters:
nameSpace - the namespace to identify the custom serializer.
localPart - the localPart as defined in the service. This together with the namespace specified above identifies a unique serializer or deserializer.
classOfObject - instance of Class. This represents the Class of the parameter.
serializerClass - instance of Class. This represents the class used to convert the parameter to XML.
deserializerClass - instance of Class. This represents the class used to convert XMl to first class Java Objects.
Since:
0.90

mapElements

public void mapElements(java.lang.String elementName,
                        java.lang.Class classOfObject,
                        java.lang.Class deserializerClass)
Maps an element name to the class the element body is to be deserialized to. This mapping is neccessary to address situations where the SOAP response from a service does not specify the data type for an element. MSSoap, .NET and White Mesa SOAP are examples where typing information is not available in response. During deserialization process, Wingfoot SOAP uses this mapping between the XML element name and the Class. If the application is confident that the response includes typing information, this mapping is not required.
Parameters:
elementName - the name of the element as returned in the response. This information is usually available in the WSDL.
classOfObject - instance of Class that the element should be deserialized to. This instance is returned back to the user.
deserializerClass - instance of Class that represents (if applicable) the class used in deserialization. Only needed if custom deserialization is required (example BeanSerializer) For primitive wrapper classes, this is left as null.
Since:
0.90

getClassForElement

public java.lang.String[] getClassForElement(java.lang.String elementName)
Given an element name, determines the proper class for the contents of the elements to be deserialized to.
Parameters:
elementName - the name of the element from the SOAP response.
Returns:
String[] with the name of the class; null if the element is not mapped to a class. String[0] contains the instance of the class to deserialize to and String[1] contains the deserializer class or null if no deserializer class is needed.
Since:
0.90

getInfoForClass

public java.lang.String[] getInfoForClass(java.lang.String className)
Returns an array of String (String[]) with information for the class.
Parameters:
className - String representation of the name of the class of the parameter.
Returns:
String[] with info for the class. The elements of the array are as follows: String[0] - namespace String[1] - localPart String[2] - Serializer class name String[3] - Deserializer class name. If the class is not mapped, a null is returned.
Since:
0.90

getInfoForNamespace

public java.lang.String[] getInfoForNamespace(java.lang.String namespace,
                                              java.lang.String localPart)
Given an namespace and localpart, returns information that is useful in deserialization of a parameter.
Parameters:
namespace - the namespace of the parameter.
localpart - the localpart of the parameter.
Returns:
String[] with information for the namespace The information in the array is as follows: String[0] - Class.getName() String[1] - serializer class name String[2] - deserializer class name
Since:
0.90


Copyright(c) Wingfoot Software (www.wingfoot.com). All Rights Reserved.

KXML is a XML parser by Lutris Technologies