BeanDeserializerFactorypublic class BeanDeserializerFactory extends BaseDeserializerFactory DeserializerFactory for Bean |
Fields Summary |
---|
protected transient org.apache.axis.description.TypeDesc | typeDescType 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.Deserializer | getGeneralPurpose(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.Map | getProperties(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 void | readObject(java.io.ObjectInputStream in)
in.defaultReadObject();
typeDesc = TypeDesc.getTypeDescForClass(javaType);
propertyMap = getProperties(javaType, typeDesc);
|
|