javax.xml.rpc.encoding

Interface TypeMapping

public interface TypeMapping

Represents a type mapping

Method Summary

DeserializerFactory
getDeserializer(Class<T> javaType, QName xmlType)
Returns the deserializer for the java type.
SerializerFactory
getSerializer(Class<T> javaType, QName xmlType)
Returns the serializer for the java type.
String[]
getSupportedEncodings()
Returns the encoding URIs.
boolean
isRegistered(Class<T> javaType, QName xmlType)
Tests if the type is registered.
void
register(Class<T> javaType, QName xmlType, SerializerFactory sf, DeserializerFactory dsf)
Registers the type.
void
removeDeserializer(Class<T> javaType, QName xmlType)
Removes the deserializer for the java type.
void
removeSerializer(Class<T> javaType, QName xmlType)
Removes the serializer for the java type.
void
setSupportedEncodings(String[] uris)
Sets the encoding URIs.

Method Details

getDeserializer

public DeserializerFactory getDeserializer(Class<T> javaType,
                                           QName xmlType)
Returns the deserializer for the java type.
Usages and Demos :

View More Examples of getDeserializer(Class javaType,QName xmlType)
   1: import javax.xml.rpc.encoding.DeserializerFactory;
   2: import javax.xml.rpc.encoding.TypeMapping;
   3: import javax.xml.soap.Name;
   4:         ...
   5:                 List list = new ArrayList(arraySize);
   6:                 TypeMapping tm = context.getTypeMappingRegistry().getDefaultTypeMapping();
   7:                         Object rtnObject = null;
   8:         ...
   9:                 List list = new ArrayList(arraySize);
  10:                 TypeMapping tm = context.getTypeMappingRegistry().getDefaultTypeMapping();
  11:                 QName innerQName = null;
  12:         ...
  13:                         DeserializerFactory df =
  14:                 tm.getDeserializer(clsInner, innerQName);

View Full Code Here
   1:     
   2:     private TypeMapping mTypeMapping;
   3:     
   4:         ...
   5:     
   6:     public Types (TypeMapping typeMapping) {
   7:         mTypeMapping = typeMapping;
   8:         ...
   9:         DeserializerFactory deserializerFactory =
  10:             mTypeMapping.getDeserializer(javaType, xmlType);
  11:         if (null == serializerFactory) {

View Full Code Here
   1: import javax.xml.rpc.JAXRPCException;
   2: import javax.xml.rpc.encoding.TypeMapping;
   3: import javax.xml.rpc.soap.SOAPFaultException;
   4:         ...
   5:          SerializationContext serContext = msgContext.getSerializationContext();
   6:          TypeMapping typeMapping = serContext.getTypeMapping();
   7: 
   8:         ...
   9: 
  10:                DeserializerFactoryBase desFactory = (DeserializerFactoryBase)typeMapping.getDeserializer(javaType, xmlType);
  11:                if (desFactory == null)

View Full Code Here

getSerializer

public SerializerFactory getSerializer(Class<T> javaType,
                                       QName xmlType)
Returns the serializer for the java type.
Usages and Demos :

View More Examples of getSerializer(Class javaType,QName xmlType)
   1: import javax.xml.namespace.QName;
   2: import javax.xml.rpc.encoding.TypeMapping;
   3: import javax.xml.soap.SOAPElement;
   4:         ...
   5:             }
   6:                         TypeMapping tm = context.getTypeMappingRegistry().
   7:                 getDefaultTypeMapping();
   8:         ...
   9:                                                 QName aXmlType = context.getXmlType(aClass);
  10:                                 si = (SerializerImpl) tm.getSerializer(aClass, aXmlType).
  11:                     getSerializerAs(TMConstants.ENCODING_MECHANISMTYPE);

View Full Code Here
   1: import javax.xml.namespace.QName;
   2: import javax.xml.rpc.encoding.TypeMapping;
   3: import javax.xml.soap.SOAPElement;
   4:         ...
   5:         }
   6:                 TypeMapping tm = context.getTypeMappingRegistry().
   7:             getDefaultTypeMapping();
   8:         ...
   9:                 QName aXmlType = context.getXmlType(aClass);
  10:                 SerializerImpl si = (SerializerImpl) tm.getSerializer(aClass, aXmlType).
  11:             getSerializerAs(TMConstants.ENCODING_MECHANISMTYPE);

View Full Code Here
   1:     
   2:     private TypeMapping mTypeMapping;
   3:     
   4:         ...
   5:     
   6:     public Types (TypeMapping typeMapping) {
   7:         mTypeMapping = typeMapping;
   8:         ...
   9:         SerializerFactory serializerFactory =
  10:             mTypeMapping.getSerializer(javaType, xmlType);
  11:         DeserializerFactory deserializerFactory =

View Full Code Here
   1: import javax.xml.rpc.JAXRPCException;
   2: import javax.xml.rpc.encoding.TypeMapping;
   3: import javax.xml.rpc.soap.SOAPFaultException;
   4:         ...
   5:          SerializationContext serContext = msgContext.getSerializationContext();
   6:          TypeMapping typeMapping = serContext.getTypeMapping();
   7: 
   8:         ...
   9: 
  10:             SerializerFactoryBase serFactory = (SerializerFactoryBase)typeMapping.getSerializer(javaType, xmlType);
  11:             if (serFactory == null)

View Full Code Here
   1: import javax.xml.rpc.encoding.SerializerFactory;
   2: import javax.xml.rpc.encoding.TypeMapping;
   3: import javax.xml.soap.SOAPBody;
   4:         ...
   5:     
   6:     private TypeMapping mTypeMapping = null;
   7:     
   8:         ...
   9:                                     QName[] xmlTypes,
  10:                                     TypeMapping typeMapping,
  11:                                     List deserializers) {
  12:         ...
  13:                 SerializerFactory serializerFactory =
  14:             mTypeMapping.getSerializer(returnType, xmlType);

View Full Code Here

getSupportedEncodings

public String[] getSupportedEncodings()
Returns the encoding URIs.

isRegistered

public boolean isRegistered(Class<T> javaType,
                            QName xmlType)
Tests if the type is registered.

register

public void register(Class<T> javaType,
                     QName xmlType,
                     SerializerFactory sf,
                     DeserializerFactory dsf)
Registers the type.
Usages and Demos :

View More Examples of register(Class javaType,QName xmlType,SerializerFactory sf,DeserializerFactory dsf)
   1: import javax.xml.rpc.encoding.SerializerFactory;
   2: import javax.xml.rpc.encoding.TypeMapping;
   3: 
   4:         ...
   5: 
   6:     public static void register(List typeInfo, TypeMapping typeMapping) {
   7:         for (Iterator iter = typeInfo.iterator(); iter.hasNext();) {
   8:         ...
   9: 
  10:         typeMapping.register(clazz, qName, ser, deser);
  11:     }

View Full Code Here
   1:     
   2:     private TypeMapping mTypeMapping;
   3:     
   4:         ...
   5:     
   6:     public Types (TypeMapping typeMapping) {
   7:         mTypeMapping = typeMapping;
   8:         ...
   9:             }
  10:                         mTypeMapping.register(javaType, xmlType, serializerFactory, deserializerFactory);
  11:         }

View Full Code Here
   1:     TypeMappingRegistryImpl typeRegistry = new TypeMappingRegistryImpl();
   2:     TypeMapping             typeMapping;
   3:     DeserializerFactory     deserializerFactory;
   4:         ...
   5:             {     
   6:                 typeMapping = typeRegistry.getTypeMapping(((QName)parametersXMLType.elementAt(i)).getNamespaceURI());
   7:                 Class c = null;
   8:         ...
   9:         typeMapping = typeRegistry.getTypeMapping(xmlType.getNamespaceURI());
  10:         if (typeMapping != null) typeMapping.register(javaClass , xmlType, sf , df);
  11:         else
  12:         ...
  13:             typeMapping = typeRegistry.createTypeMapping();
  14:             typeMapping.register(javaClass , xmlType, sf , df);

View Full Code Here

removeDeserializer

public void removeDeserializer(Class<T> javaType,
                               QName xmlType)
Removes the deserializer for the java type.

removeSerializer

public void removeSerializer(Class<T> javaType,
                             QName xmlType)
Removes the serializer for the java type.

setSupportedEncodings

public void setSupportedEncodings(String[] uris)
Sets the encoding URIs.
Usages and Demos :

View More Examples of setSupportedEncodings(String[] uris)
   1:     {
   2:         TypeMappingImpl typeMapping = new TypeMappingImpl();
   3: 
   4:         ...
   5:         typeMapping.register(Integer.class, XMLType.SOAP_INT,new SerializerSimpleTypeFactory(Integer.class, XMLType.SOAP_INT),new DeserializerSimpleTypeFactory(Integer.class, XMLType.SOAP_INT));
   6:         addMapping(Integer.class, XMLType.SOAP_INT);
   7:         ...
   8:     
   9:         typeMapping.register(String.class, XMLType.SOAP_STRING,new SerializerSimpleTypeFactory(String.class, XMLType.SOAP_STRING),new DeserializerSimpleTypeFactory(String.class, XMLType.SOAP_STRING));
  10:         addMapping(String.class, XMLType.SOAP_STRING);
  11:         ...
  12:         String encod[] = new String[1];
  13:         typeMapping.setSupportedEncodings(encod);

View Full Code Here