package nl.dykam.dev.reutil.data;

import nl.dykam.dev.reutil.data.annotations.ApplicableTo;
import nl.dykam.dev.reutil.data.annotations.Defaults;
import nl.dykam.dev.reutil.data.annotations.ObjectType;
import nl.dykam.dev.reutil.data.annotations.Require;

class ComponentInfo {
    public static <T extends Component> Defaults getDefaults(Class<T> type) {
        return type.getAnnotation(Defaults.class);
    }

    private static <T extends Component>  ComponentBuilder<T> getBuilder(Class<T> type) {
        return ComponentBuilder.getBuilder(type);
    }

    public static <T extends Component> ObjectType[] getApplicables(Class<T> type) {
        return type.getAnnotation(ApplicableTo.class).value();
    }
    public static <T extends Component> Class<? extends Component>[] getRequired(Class<T> type) {
        return type.getAnnotation(Require.class).value();
    }
}

@@ -254,29 +254,299 @@
 e;%0A%0A
-class ComponentInfo %7B
+import java.lang.reflect.Array;%0A%0Aclass ComponentInfo %7B%0A%0A    public static final ObjectType%5B%5D OBJECT_TYPES = new ObjectType%5B0%5D;%0A    @SuppressWarnings(%22unchecked%22)%0A    public static final Class%3C? extends Component%3E%5B%5D CLASSES = (Class%3C? extends Component%3E%5B%5D) Array.newInstance(Class.class, 0);%0A
 %0A   
@@ -910,38 +910,57 @@
 type) %7B%0A        
-return
+ApplicableTo annotation =
  type.getAnnotat
@@ -982,31 +982,130 @@
 o.class)
-.value();%0A    %7D
+;%0A        return annotation == null ? OBJECT_TYPES : annotation.value();%0A    %7D%0A%0A    @SuppressWarnings(%22unchecked%22)
 %0A    pub
@@ -1195,38 +1195,52 @@
 type) %7B%0A        
-return
+Require annotation =
  type.getAnnotat
@@ -1257,16 +1257,74 @@
 e.class)
+;%0A        return annotation == null ? CLASSES : annotation
 .value()

Return Empty array when annotations are missing