diff --git a/framework/modules/core/core-config/src/main/java/io/fairyproject/config/Comments.java b/framework/modules/core/core-config/src/main/java/io/fairyproject/config/Comments.java index 6c906f14..6c5372e1 100644 --- a/framework/modules/core/core-config/src/main/java/io/fairyproject/config/Comments.java +++ b/framework/modules/core/core-config/src/main/java/io/fairyproject/config/Comments.java @@ -45,10 +45,10 @@ private Comments(List classComments, this.fieldComments = fieldComments; } - static Comments ofClass(Class cls) { + static Comments ofClass(Class cls, Configuration.Properties properties) { List classComments = getComments(cls); Map> fieldComments = new HashMap<>(); - Arrays.stream(cls.getDeclaredFields()) + properties.getFilter().filterDeclaredFieldsOf(cls).stream() .filter(field -> isCommented(field) || isNestedCommented(field)) .forEach(field -> { if (isCommented(field)) { diff --git a/framework/modules/core/core-config/src/main/java/io/fairyproject/config/Configuration.java b/framework/modules/core/core-config/src/main/java/io/fairyproject/config/Configuration.java index 21166ec1..fac5ba50 100644 --- a/framework/modules/core/core-config/src/main/java/io/fairyproject/config/Configuration.java +++ b/framework/modules/core/core-config/src/main/java/io/fairyproject/config/Configuration.java @@ -56,7 +56,7 @@ public abstract class Configuration> { */ protected Configuration(Properties properties) { this.props = Objects.requireNonNull(properties); - this.comments = Comments.ofClass(getClass()); + this.comments = Comments.ofClass(getClass(), properties); } /** diff --git a/framework/modules/core/core-config/src/main/java/io/fairyproject/config/filter/FieldFilter.java b/framework/modules/core/core-config/src/main/java/io/fairyproject/config/filter/FieldFilter.java index d7d02794..7670ff6a 100644 --- a/framework/modules/core/core-config/src/main/java/io/fairyproject/config/filter/FieldFilter.java +++ b/framework/modules/core/core-config/src/main/java/io/fairyproject/config/filter/FieldFilter.java @@ -56,7 +56,7 @@ default List filterDeclaredFieldsOf(Class cls) { Class current = cls; do { if (current == cls || accepted.contains(current)) { - fields.addAll(Arrays.asList(current.getDeclaredFields())); + fields.addAll(0, Arrays.asList(current.getDeclaredFields())); } current = current.getSuperclass(); } while (current != Object.class && current != null); diff --git a/global.properties b/global.properties index 277f7905..25fe42f0 100644 --- a/global.properties +++ b/global.properties @@ -1 +1 @@ -version = 0.7.9b3-SNAPSHOT \ No newline at end of file +version = 0.7.9b4-SNAPSHOT \ No newline at end of file