beanExcludeInfo = axisService.getExcludeInfo().getBeanExcludeInfoForClass(
jClass.getQualifiedName());
}
// properties from JAM
ArrayList propertyList = new ArrayList();
JProperty properties [] = jClass.getDeclaredProperties();
for (int i = 0; i < properties.length; i++) {
JProperty property = properties[i];
String propertyName = getCorrectName(property.getSimpleName());
if ((beanExcludeInfo == null) || !beanExcludeInfo.isExcludedProperty(propertyName)){
propertyList.add(property);
}
}
JClass supClass = jClass.getSuperclass();
while (!supClass.getQualifiedName().startsWith("java.")) {
properties = supClass.getDeclaredProperties();
ExcludeInfo excludeInfo = axisService.getExcludeInfo();
if (excludeInfo != null) {
beanExcludeInfo = excludeInfo.getBeanExcludeInfoForClass(supClass.getQualifiedName());
}
for (int i = 0; i < properties.length; i++) {
JProperty property = properties[i];
String propertyName = getCorrectName(property.getSimpleName());
if ((beanExcludeInfo == null) || !beanExcludeInfo.isExcludedProperty(propertyName)) {
propertyList.add(property);
}
}
supClass = supClass.getSuperclass();
}
properties = new JProperty[propertyList.size()];
for (int i = 0; i < propertyList.size(); i++) {
JProperty jProperty = (JProperty)propertyList.get(i);
properties[i] = jProperty;
}
Arrays.sort(properties);
BeanInfo beanInfo = Introspector.getBeanInfo(beanObject.getClass());
PropertyDescriptor [] propDescs = beanInfo.getPropertyDescriptors();
HashMap propertMap = new HashMap();
for (int i = 0; i < propDescs.length; i++) {
PropertyDescriptor propDesc = propDescs[i];
if (propDesc.getName().equals("class")) {
continue;
}
propertMap.put(propDesc.getName(), propDesc);
}
ArrayList object = new ArrayList();
for (int i = 0; i < properties.length; i++) {
JProperty property = properties[i];
PropertyDescriptor propDesc = (PropertyDescriptor)propertMap.get(
getCorrectName(property.getSimpleName()));
if (propDesc == null) {
propDesc = (PropertyDescriptor)propertMap.get(
(property.getSimpleName()));
}
if (propDesc == null) {
continue;
}
Class ptype = propDesc.getPropertyType();
if (propDesc.getName().equals("class")) {
continue;
}
if (SimpleTypeMapper.isSimpleType(ptype)) {
Method readMethod = propDesc.getReadMethod();
Object value;
if(readMethod!=null){
if (property.getGetter() !=null && property.getGetter().isPublic()){
readMethod.setAccessible(true);
}
value = readMethod.invoke(beanObject, null);
} else {
throw new AxisFault("can not find read method for : " + propDesc.getName());
}
addTypeQname(elemntNameSpace, object, propDesc, beanName,processingDocLitBare);
object.add(value == null ? null : SimpleTypeMapper.getStringValue(value));
} else if (ptype.isArray()) {
if (SimpleTypeMapper.isSimpleType(ptype.getComponentType())) {
Method readMethod = propDesc.getReadMethod();
Object value;
if(readMethod!=null){
if (property.getGetter() !=null && property.getGetter().isPublic()){
readMethod.setAccessible(true);
}
value = readMethod.invoke(beanObject,null);
} else {
throw new AxisFault("can not find read method for : " + propDesc.getName());
}
if (value != null) {
if("byte".equals(ptype.getComponentType().getName())) {
addTypeQname(elemntNameSpace, object, propDesc, beanName,processingDocLitBare);
object.add(Base64.encode((byte[]) value));
} else {
int i1 = Array.getLength(value);
for (int j = 0; j < i1; j++) {
Object o = Array.get(value, j);
addTypeQname(elemntNameSpace, object, propDesc, beanName,processingDocLitBare);
object.add(o == null ? null : SimpleTypeMapper.getStringValue(o));
}
}
} else {
addTypeQname(elemntNameSpace, object, propDesc, beanName,processingDocLitBare);
object.add(value);
}
} else {
Method readMethod = propDesc.getReadMethod();
Object value [] = null;
if(readMethod!=null){
if (property.getGetter() !=null && property.getGetter().isPublic()){
readMethod.setAccessible(true);
}
value = (Object[])propDesc.getReadMethod().invoke(beanObject,
null);
}
if (value != null) {
for (int j = 0; j < value.length; j++) {
Object o = value[j];
addTypeQname(elemntNameSpace, object, propDesc, beanName,processingDocLitBare);
object.add(o);
}
} else {
addTypeQname(elemntNameSpace, object, propDesc, beanName,processingDocLitBare);
object.add(value);
}
}
} else if (SimpleTypeMapper.isCollection(ptype)) {
Method readMethod = propDesc.getReadMethod();
if (property.getGetter() !=null && property.getGetter().isPublic()){
readMethod.setAccessible(true);
}
Object value = readMethod.invoke(beanObject,
null);
Collection objList = (Collection)value;
if (objList != null && objList.size() > 0) {
//this was given error , when the array.size = 0
// and if the array contain simple type , then the ADBPullParser asked
// PullParser from That simpel type
for (Iterator j = objList.iterator(); j.hasNext();) {
Object o = j.next();
if (SimpleTypeMapper.isSimpleType(o)) {
addTypeQname(elemntNameSpace, object, propDesc, beanName,processingDocLitBare);
object.add(o);
} else {
addTypeQname(elemntNameSpace, object, propDesc, beanName ,processingDocLitBare);
object.add(o);
}
}
} else {
addTypeQname(elemntNameSpace, object, propDesc, beanName,processingDocLitBare);
object.add(value);
}
} else {
addTypeQname(elemntNameSpace, object, propDesc, beanName,processingDocLitBare);
Method readMethod = propDesc.getReadMethod();
if (property.getGetter() !=null && property.getGetter().isPublic()){
readMethod.setAccessible(true);
}
Object value = readMethod.invoke(beanObject,
null);
if ("java.lang.Object".equals(ptype.getName())){