Преглед изворни кода

Move Ignore annotation to ConfigEntries and rename to Exclude

Lortseam пре 4 година
родитељ
комит
76964a6c7b

+ 0 - 10
lib/src/main/java/me/lortseam/completeconfig/api/ConfigContainer.java

@@ -48,15 +48,5 @@ public interface ConfigContainer {
     @interface Transitive {
 
     }
-
-    /**
-     * Applied to declare that a field should not be resolved as config entry.
-     * This annotation is needed to exclude fields if the {@link ConfigEntries} annotation was applied to the class.
-     */
-    @Target(ElementType.FIELD)
-    @Retention(RetentionPolicy.RUNTIME)
-    @interface Ignore {
-
-    }
     
 }

+ 10 - 1
lib/src/main/java/me/lortseam/completeconfig/api/ConfigEntries.java

@@ -8,7 +8,7 @@ import java.lang.annotation.Target;
 /**
  * Applied to declare that every field of a class should be resolved as config entry.
  *
- * <p>Use {@link ConfigContainer.Ignore} to exclude a field.
+ * <p>Use {@link Exclude} to exclude a field.
  *
  * @see ConfigEntry
  */
@@ -16,4 +16,13 @@ import java.lang.annotation.Target;
 @Retention(RetentionPolicy.RUNTIME)
 public @interface ConfigEntries {
 
+    /**
+     * Applied to declare that a field should not be resolved as config entry.
+     */
+    @Target(ElementType.FIELD)
+    @Retention(RetentionPolicy.RUNTIME)
+    @interface Exclude {
+
+    }
+
 }

+ 1 - 1
lib/src/main/java/me/lortseam/completeconfig/data/EntrySet.java

@@ -29,7 +29,7 @@ public class EntrySet extends DataSet<Entry> {
                     return false;
                 }
                 if (clazz.isAnnotationPresent(ConfigEntries.class)) {
-                    return !ConfigContainer.class.isAssignableFrom(field.getType()) && !field.isAnnotationPresent(ConfigContainer.Ignore.class) && !Modifier.isTransient(field.getModifiers());
+                    return !ConfigContainer.class.isAssignableFrom(field.getType()) && !field.isAnnotationPresent(ConfigEntries.Exclude.class) && !Modifier.isTransient(field.getModifiers());
                 }
                 return field.isAnnotationPresent(ConfigEntry.class);
             }).map(field -> {