protected void registerClassAsWithDefaultSearialization(Class cls, QName q, SOAPBinding.Style style,
SOAPBinding.Use use) {
try {
logger.debug("Assigned Default Serialization to class: " + cls.getCanonicalName()
+ " qname:" + q);
TypeDesc td = TypeDesc.getTypeDescForClass(cls); // a class can
// provide its
// own
// descriptors
TypeDesc superTd = null;
BeanPropertyDescriptor[] superPd = null;
boolean shoudRegisterFields = false;
if (null == td) {
shoudRegisterFields = true;
td = new TypeDesc(cls);
Class supa = cls.getSuperclass();
if ((supa != null) && (supa != java.lang.Object.class)
&& (supa != java.lang.Exception.class)
&& (supa != java.lang.Throwable.class)
&& (supa != java.rmi.RemoteException.class)
&& (supa != org.apache.axis.AxisFault.class)) {
registerType(supa, style, use);
superTd = TypeDesc.getTypeDescForClass(supa);
if (superTd != null) {
superPd = superTd.getPropertyDescriptors();
}
}
td.setXmlType(q);
TypeDesc.registerTypeDescForClass(cls, td);
}
mTypeMapping.register(cls, q, new BeanSerializerFactory(cls, q),
/*
* NOTE jcolwell@bea.com 2004-Oct-11 -- should check that the type
* to deserialize has a default contructor but with this setup there
* is no way to know if it is used only in serialization.
*/
new BeanDeserializerFactory(cls, q));
Map serProps = BeanDeserializerFactory.getProperties(cls, null);
for (BeanPropertyDescriptor beanProps : (Collection<BeanPropertyDescriptor>) serProps
.values()) {
Class subType = beanProps.getType();
if (!(subType.isPrimitive()
|| subType.getName().startsWith("java.") || subType
.getName().startsWith("javax."))) {
registerType(subType, style, use);
}
if (shoudRegisterFields) {
String ns = q.getNamespaceURI();
if (superTd != null && superPd != null) {
for (int j = 0; j < superPd.length; j++) {
if (beanProps.getName()
.equals(superPd[j].getName())) {
ns = superTd.getXmlType().getNamespaceURI();
break;
}
}
}
FieldDesc fd = new ElementDesc();