Set propertiesSet = new HashSet();
Set propertiesNames = new HashSet();
JProperty[] tempProperties = javaType.getDeclaredProperties();
BeanExcludeInfo beanExcludeInfo = null;
if (service.getExcludeInfo() !=null) {
beanExcludeInfo = service.getExcludeInfo().getBeanExcludeInfoForClass(
javaType.getQualifiedName());
}
for (int i = 0; i < tempProperties.length; i++) {
JProperty tempProperty = tempProperties[i];
String propertyName = getCorrectName(tempProperty.getSimpleName());
if ((beanExcludeInfo == null) || !beanExcludeInfo.isExcludedProperty(propertyName)){
propertiesSet.add(tempProperty);
}
}
JProperty[] properties = (JProperty[]) propertiesSet.toArray(new JProperty[0]);
Arrays.sort(properties);
for (int i = 0; i < properties.length; i++) {
JProperty property = properties[i];
boolean isArryType = property.getType().isArrayType();
String propname = getCorrectName(property.getSimpleName());
propertiesNames.add(propname);
this.generateSchemaforFieldsandProperties(xmlSchema, sequence, property.getType(),
propname, isArryType);
}
JField[] tempFields = javaType.getDeclaredFields();
HashMap FieldMap = new HashMap();
for (int i = 0; i < tempFields.length; i++) {
// create a element for the field only if it is public
// and there is no property with the same name
if (tempFields[i].isPublic()) {
if (tempFields[i].isStatic()){
// We do not need to expose static fields
continue;
}
String propertyName = getCorrectName(tempFields[i].getSimpleName());
if ((beanExcludeInfo == null) || !beanExcludeInfo.isExcludedProperty(propertyName)) {
// skip field with same name as a property
if (!propertiesNames.contains(tempFields[i].getSimpleName())) {
FieldMap.put(tempFields[i].getSimpleName(), tempFields[i]);
}