Configurator now checks the whole inherited class hierarchy
This commit is contained in:
parent
2fcc8e98c5
commit
123044aaf3
1 changed files with 9 additions and 8 deletions
|
|
@ -94,9 +94,9 @@ public class Configurator<T> {
|
|||
protected static ConfigurationParam[] getConfiguration(Class c, Object obj){
|
||||
ArrayList<ConfigurationParam> conf = new ArrayList<ConfigurationParam>();
|
||||
|
||||
Field[] all = c.getDeclaredFields();
|
||||
for(Field f : all){
|
||||
if(f.isAnnotationPresent(Configurable.class) &&
|
||||
for(Class<?> cc = c; cc != Object.class ;cc = cc.getSuperclass()) { // iterate through all super classes
|
||||
for (Field f : cc.getDeclaredFields()) {
|
||||
if (f.isAnnotationPresent(Configurable.class) &&
|
||||
!Modifier.isStatic(f.getModifiers()) && !Modifier.isTransient(f.getModifiers())) {
|
||||
try {
|
||||
conf.add(new ConfigurationParam(f, obj));
|
||||
|
|
@ -105,6 +105,7 @@ public class Configurator<T> {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ConfigurationParam[] list = conf.toArray(new ConfigurationParam[conf.size()]);
|
||||
Arrays.sort(list);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue