Map<String, Field> modelFields = new LinkedHashMap<String, Field>();
for (java.lang.reflect.Field fld : cls.getDeclaredFields()){
if (Modifier.isStatic(fld.getModifiers())) {
try {
if (fld.get(null) instanceof Field) {
Field modelField = (Field) fld.get(null);
modelFields.put(fld.getName(), modelField);
}
} catch (IllegalAccessException e) {
}
}
}
for (java.lang.reflect.Field fld : getAllFields(cls.getSuperclass())){
if (Modifier.isStatic(fld.getModifiers())) {
try {
if (fld.get(null) instanceof Field) {
Field modelField = (Field) fld.get(null);
try {
modelFields.put(fld.getName(), modelField.copy());
} catch (DBException e) {
e.printStackTrace();
}
}
} catch (IllegalAccessException e) {