Search in sources :

Example 1 with SerializerFactory

use of javax.xml.rpc.encoding.SerializerFactory in project tomee by apache.

the class JavaServiceDescBuilder method registerType.

private void registerType(JaxRpcTypeInfo type, TypeMapping typeMapping) throws OpenEJBException {
    Class javaType;
    try {
        javaType = classLoader.loadClass(type.javaType);
    } catch (ClassNotFoundException e) {
        throw new OpenEJBException("Could not load class for JaxRpc mapping " + type.javaType);
    }
    // Default uses the generic Java Beans serializer/deserializer
    Class serializerFactoryClass = BeanSerializerFactory.class;
    Class deserializerFactoryClass = BeanDeserializerFactory.class;
    switch(type.serializerType) {
        case ARRAY:
            serializerFactoryClass = ArraySerializerFactory.class;
            deserializerFactoryClass = ArrayDeserializerFactory.class;
            break;
        case ENUM:
            serializerFactoryClass = EnumSerializerFactory.class;
            deserializerFactoryClass = EnumDeserializerFactory.class;
            break;
        case LIST:
            serializerFactoryClass = SimpleListSerializerFactory.class;
            deserializerFactoryClass = SimpleListDeserializerFactory.class;
            break;
        default:
            if (type.simpleBaseType != null) {
                Class clazz = SOAP_TYPE_MAPPING.getClassForQName(type.simpleBaseType, null, null);
                if (null != clazz) {
                    // Built in SOAP type
                    serializerFactoryClass = SOAP_TYPE_MAPPING.getSerializer(clazz, type.simpleBaseType).getClass();
                    deserializerFactoryClass = SOAP_TYPE_MAPPING.getDeserializer(clazz, type.simpleBaseType, null).getClass();
                } else {
                    clazz = JAXRPC_TYPE_MAPPING.getClassForQName(type.simpleBaseType, null, null);
                    if (null != clazz) {
                        // Built in XML schema type
                        serializerFactoryClass = JAXRPC_TYPE_MAPPING.getSerializer(clazz, type.simpleBaseType).getClass();
                        deserializerFactoryClass = JAXRPC_TYPE_MAPPING.getDeserializer(clazz, type.simpleBaseType, null).getClass();
                    }
                }
            }
            break;
    }
    SerializerFactory serializerFactory = BaseSerializerFactory.createFactory(serializerFactoryClass, javaType, type.qname);
    DeserializerFactory deserializerFactory = BaseDeserializerFactory.createFactory(deserializerFactoryClass, javaType, type.qname);
    typeMapping.register(javaType, type.qname, serializerFactory, deserializerFactory);
}
Also used : OpenEJBException(org.apache.openejb.OpenEJBException) BaseDeserializerFactory(org.apache.axis.encoding.ser.BaseDeserializerFactory) ArrayDeserializerFactory(org.apache.axis.encoding.ser.ArrayDeserializerFactory) BeanDeserializerFactory(org.apache.axis.encoding.ser.BeanDeserializerFactory) EnumDeserializerFactory(org.apache.axis.encoding.ser.EnumDeserializerFactory) DeserializerFactory(javax.xml.rpc.encoding.DeserializerFactory) SimpleListDeserializerFactory(org.apache.axis.encoding.ser.SimpleListDeserializerFactory) SimpleListSerializerFactory(org.apache.axis.encoding.ser.SimpleListSerializerFactory) BeanSerializerFactory(org.apache.axis.encoding.ser.BeanSerializerFactory) BaseSerializerFactory(org.apache.axis.encoding.ser.BaseSerializerFactory) ArraySerializerFactory(org.apache.axis.encoding.ser.ArraySerializerFactory) EnumSerializerFactory(org.apache.axis.encoding.ser.EnumSerializerFactory) SerializerFactory(javax.xml.rpc.encoding.SerializerFactory) BeanDeserializerFactory(org.apache.axis.encoding.ser.BeanDeserializerFactory) BeanSerializerFactory(org.apache.axis.encoding.ser.BeanSerializerFactory)

Example 2 with SerializerFactory

use of javax.xml.rpc.encoding.SerializerFactory in project tomee by apache.

the class TypeInfo method register.

public void register(TypeMapping typeMapping) {
    SerializerFactory ser = BaseSerializerFactory.createFactory(serFactoryClass, clazz, qName);
    DeserializerFactory deser = BaseDeserializerFactory.createFactory(deserFactoryClass, clazz, qName);
    typeMapping.register(clazz, qName, ser, deser);
}
Also used : BaseDeserializerFactory(org.apache.axis.encoding.ser.BaseDeserializerFactory) DeserializerFactory(javax.xml.rpc.encoding.DeserializerFactory) BaseSerializerFactory(org.apache.axis.encoding.ser.BaseSerializerFactory) SerializerFactory(javax.xml.rpc.encoding.SerializerFactory)

Aggregations

DeserializerFactory (javax.xml.rpc.encoding.DeserializerFactory)2 SerializerFactory (javax.xml.rpc.encoding.SerializerFactory)2 BaseDeserializerFactory (org.apache.axis.encoding.ser.BaseDeserializerFactory)2 BaseSerializerFactory (org.apache.axis.encoding.ser.BaseSerializerFactory)2 ArrayDeserializerFactory (org.apache.axis.encoding.ser.ArrayDeserializerFactory)1 ArraySerializerFactory (org.apache.axis.encoding.ser.ArraySerializerFactory)1 BeanDeserializerFactory (org.apache.axis.encoding.ser.BeanDeserializerFactory)1 BeanSerializerFactory (org.apache.axis.encoding.ser.BeanSerializerFactory)1 EnumDeserializerFactory (org.apache.axis.encoding.ser.EnumDeserializerFactory)1 EnumSerializerFactory (org.apache.axis.encoding.ser.EnumSerializerFactory)1 SimpleListDeserializerFactory (org.apache.axis.encoding.ser.SimpleListDeserializerFactory)1 SimpleListSerializerFactory (org.apache.axis.encoding.ser.SimpleListSerializerFactory)1 OpenEJBException (org.apache.openejb.OpenEJBException)1