FileDocCategorySizeDatePackage
BeanDeserializerFactory.javaAPI DocApache Axis 1.43341Sat Apr 22 18:57:28 BST 2006org.apache.axis.encoding.ser

BeanDeserializerFactory

public class BeanDeserializerFactory extends BaseDeserializerFactory
DeserializerFactory for Bean
author
Rich Scheuerle
author
Sam Ruby

Fields Summary
protected transient org.apache.axis.description.TypeDesc
typeDesc
Type metadata about this class for XML deserialization
protected transient Map
propertyMap
Constructors Summary
public BeanDeserializerFactory(Class javaType, QName xmlType)


         
        super(BeanDeserializer.class, xmlType, javaType);
        
        // Sometimes an Enumeration class is registered as a Bean.
        // If this is the case, silently switch to the EnumDeserializer
        if (JavaUtils.isEnumClass(javaType)) {
            deserClass = EnumDeserializer.class;
        }

        typeDesc = TypeDesc.getTypeDescForClass(javaType);
        propertyMap = getProperties(javaType, typeDesc);
    
Methods Summary
protected org.apache.axis.encoding.DeserializergetGeneralPurpose(java.lang.String mechanismType)
Optimize construction of a BeanDeserializer by caching the type descriptor and property map.

        if (javaType == null || xmlType == null) {
           return super.getGeneralPurpose(mechanismType);
        }

        if (deserClass == EnumDeserializer.class) {
           return super.getGeneralPurpose(mechanismType);
        }

        return new BeanDeserializer(javaType, xmlType, typeDesc, propertyMap);
    
public static java.util.MapgetProperties(java.lang.Class javaType, org.apache.axis.description.TypeDesc typeDesc)
Get a list of the bean properties

        Map propertyMap = null;

        if (typeDesc != null) {
            propertyMap = typeDesc.getPropertyDescriptorMap();
        } else {
            BeanPropertyDescriptor[] pd = BeanUtils.getPd(javaType, null);
            propertyMap = new HashMap();
            // loop through properties and grab the names for later
            for (int i = 0; i < pd.length; i++) {
                BeanPropertyDescriptor descriptor = pd[i];
                propertyMap.put(descriptor.getName(), descriptor);
            }
        }

        return propertyMap;
    
private voidreadObject(java.io.ObjectInputStream in)

        in.defaultReadObject();
        typeDesc = TypeDesc.getTypeDescForClass(javaType);
        propertyMap = getProperties(javaType, typeDesc);