/** * Will find all the initialize fields in the class * * @param annotatedType The class to search for fields * @param locator The locator to use when analyzing the class * @param errorCollector The error collector * @return A non-null but possibly empty set of initializer fields */ public static Set<Field> findInitializerFields(Class<?> annotatedType, ServiceLocatorImpl locator, Collector errorCollector) { LinkedHashSet<Field> retVal = new LinkedHashSet<Field>(); ClassReflectionHelper crh = locator.getClassReflectionHelper(); Set<Field> fields = crh.getAllFields(annotatedType); for (Field field : fields) { if (!locator.hasInjectAnnotation(field)) { // Not an initializer field continue; } if (!isProperField(field)) { errorCollector.addThrowable(new IllegalArgumentException("The field " + Pretty.field(field) + " may not be static, final or have an Annotation type")); continue; } retVal.add(field); } return retVal; }
/** * Will find all the initialize fields in the class * * @param annotatedType The class to search for fields * @param locator The locator to use when analyzing the class * @param errorCollector The error collector * @return A non-null but possibly empty set of initializer fields */ public static Set<Field> findInitializerFields(Class<?> annotatedType, ServiceLocatorImpl locator, Collector errorCollector) { LinkedHashSet<Field> retVal = new LinkedHashSet<Field>(); ClassReflectionHelper crh = locator.getClassReflectionHelper(); Set<Field> fields = crh.getAllFields(annotatedType); for (Field field : fields) { if (!locator.hasInjectAnnotation(field)) { // Not an initializer field continue; } if (!isProperField(field)) { errorCollector.addThrowable(new IllegalArgumentException("The field " + Pretty.field(field) + " may not be static, final or have an Annotation type")); continue; } retVal.add(field); } return retVal; }
/** * Will find all the initialize fields in the class * * @param annotatedType The class to search for fields * @param locator The locator to use when analyzing the class * @param errorCollector The error collector * @return A non-null but possibly empty set of initializer fields */ public static Set<Field> findInitializerFields(Class<?> annotatedType, ServiceLocatorImpl locator, Collector errorCollector) { LinkedHashSet<Field> retVal = new LinkedHashSet<Field>(); ClassReflectionHelper crh = locator.getClassReflectionHelper(); Set<Field> fields = crh.getAllFields(annotatedType); for (Field field : fields) { if (!locator.hasInjectAnnotation(field)) { // Not an initializer field continue; } if (!isProperField(field)) { errorCollector.addThrowable(new IllegalArgumentException("The field " + Pretty.field(field) + " may not be static, final or have an Annotation type")); continue; } retVal.add(field); } return retVal; }
/** * Will find all the initialize fields in the class * * @param annotatedType The class to search for fields * @param locator The locator to use when analyzing the class * @param errorCollector The error collector * @return A non-null but possibly empty set of initializer fields */ public static Set<Field> findInitializerFields(Class<?> annotatedType, ServiceLocatorImpl locator, Collector errorCollector) { LinkedHashSet<Field> retVal = new LinkedHashSet<Field>(); ClassReflectionHelper crh = locator.getClassReflectionHelper(); Set<Field> fields = crh.getAllFields(annotatedType); for (Field field : fields) { if (!locator.hasInjectAnnotation(field)) { // Not an initializer field continue; } if (!isProperField(field)) { errorCollector.addThrowable(new IllegalArgumentException("The field " + Pretty.field(field) + " may not be static, final or have an Annotation type")); continue; } retVal.add(field); } return retVal; }