FileDocCategorySizeDatePackage
DefaultSOAPEncodingTypeMappingImpl.javaAPI DocApache Axis 1.45435Sat Apr 22 18:57:28 BST 2006org.apache.axis.encoding

DefaultSOAPEncodingTypeMappingImpl

public class DefaultSOAPEncodingTypeMappingImpl extends DefaultTypeMappingImpl
This is the implementation of the axis Default JAX-RPC SOAP Encoding TypeMapping See DefaultTypeMapping for more information.
author
Rich Scheuerle (scheu@us.ibm.com)

Fields Summary
private static DefaultSOAPEncodingTypeMappingImpl
tm
Constructors Summary
protected DefaultSOAPEncodingTypeMappingImpl()

        super(true);
        registerSOAPTypes();
    
Methods Summary
public static TypeMappingDelegatecreateWithDelegate()

        TypeMappingDelegate ret = new TypeMappingDelegate(new DefaultSOAPEncodingTypeMappingImpl());
        MessageContext mc = MessageContext.getCurrentContext();
        TypeMappingDelegate tm = null;
        if (mc != null) {
            tm = (TypeMappingDelegate)mc.getTypeMappingRegistry().getDefaultTypeMapping();
        } else {
            tm = DefaultTypeMappingImpl.getSingletonDelegate();
        }
        ret.setNext(tm);
        return ret;
    
public static synchronized TypeMappingImplgetSingleton()
Construct TypeMapping

           
         
        if (tm == null) {
            tm = new DefaultSOAPEncodingTypeMappingImpl();
        }
        return tm;
    
private voidregisterSOAPTypes()
Register the SOAP encoding data types. This is split out into a method so it can happen either before or after the XSD mappings.

        // SOAP Encoded strings are treated as primitives.
        // Everything else is not.
        myRegisterSimple(Constants.SOAP_STRING, java.lang.String.class);
        myRegisterSimple(Constants.SOAP_BOOLEAN, java.lang.Boolean.class);
        myRegisterSimple(Constants.SOAP_DOUBLE, java.lang.Double.class);
        myRegisterSimple(Constants.SOAP_FLOAT, java.lang.Float.class);
        myRegisterSimple(Constants.SOAP_INT, java.lang.Integer.class);
        myRegisterSimple(Constants.SOAP_INTEGER, java.math.BigInteger.class);
        myRegisterSimple(Constants.SOAP_DECIMAL, java.math.BigDecimal.class);
        myRegisterSimple(Constants.SOAP_LONG, java.lang.Long.class);
        myRegisterSimple(Constants.SOAP_SHORT, java.lang.Short.class);
        myRegisterSimple(Constants.SOAP_BYTE, java.lang.Byte.class);

        myRegister(Constants.SOAP_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64)
        );
        myRegister(Constants.SOAP_BASE64BINARY,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64BINARY),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64BINARY)
        );

        myRegister(Constants.SOAP_ARRAY12,     java.util.Collection.class,
                   new ArraySerializerFactory(),
                   new ArrayDeserializerFactory()
        );
        myRegister(Constants.SOAP_ARRAY12,     java.util.ArrayList.class,
                   new ArraySerializerFactory(),
                   new ArrayDeserializerFactory()
        );

        myRegister(Constants.SOAP_ARRAY12,     Object[].class,
                   new ArraySerializerFactory(),
                   new ArrayDeserializerFactory()
        );

        myRegister(Constants.SOAP_ARRAY,     java.util.ArrayList.class,
                   new ArraySerializerFactory(),
                   new ArrayDeserializerFactory()
        );

        // All array objects automatically get associated with the SOAP_ARRAY.
        // There is no way to do this with a hash table,
        // so it is done directly in getTypeQName.
        // Internally the runtime uses ArrayList objects to hold arrays...
        // which is the reason that ArrayList is associated with SOAP_ARRAY.
        // In addition, handle all objects that implement the List interface
        // as a SOAP_ARRAY
        myRegister(Constants.SOAP_ARRAY,     java.util.Collection.class,
                   new ArraySerializerFactory(),
                   new ArrayDeserializerFactory()
        );

        myRegister(Constants.SOAP_ARRAY,     Object[].class,
                   new ArraySerializerFactory(),
                   new ArrayDeserializerFactory()
        );