public void makeEntity(Element element ,List outlist) {
List l = element.getChild("disp").getChildren("column");
XmlcloumnsEntity xmlcloumnsEntity= new XmlcloumnsEntity();
for (int j = 0; j < l.size(); j++) {
xmlcloumnsEntity = new XmlcloumnsEntity();
Element column = (Element)l.get(j);
elementToXmlcloumnsEntity(xmlcloumnsEntity,column) ;
outlist.add(xmlcloumnsEntity);
}
}
public XmlcloumnsEntity elementToXmlcloumnsEntity( XmlcloumnsEntity xmlEntity ,Element element ) {
Class clazz = xmlEntity.getClass();
Field[] fields=clazz.getDeclaredFields();
for(int i=0;i < fields.length ; i ++ ){
Field field=fields[i];
String fieldName=field.getName();
String stringLetter=fieldName.substring(0, 1).toUpperCase();
String setName="set"+stringLetter+fieldName.substring(1);
Method setMethod;
try {
setMethod = clazz.getMethod(setName, new Class[]{field.getType()});
setMethod.invoke(xmlEntity,new Object[]{element.getAttributeValue(fieldName)==null?"":element.getAttributeValue(fieldName)});
} catch (SecurityException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
return xmlEntity;
}