@Override public boolean equals(final Object o) { if (!(o instanceof AnnotationEnumValue)) { return false; } return compareTo((AnnotationEnumValue) o) == 0; }
/** * Loads the enum class, instantiates the enum constants for the class, and returns the enum constant value * represented by this {@link AnnotationEnumValue}. * * @return The enum constant value represented by this {@link AnnotationEnumValue} * @throws IllegalArgumentException * if the class could not be loaded, or the enum constant is invalid. */ public Object loadClassAndReturnEnumValue() throws IllegalArgumentException { return loadClassAndReturnEnumValue(/* ignoreExceptions = */ false); }
field = classRef.getDeclaredField(valueName); } catch (final Exception e) { throw new IllegalArgumentException("Could not find enum constant " + toString(), e); throw new IllegalArgumentException("Field " + toString() + " is not an enum constant"); throw new IllegalArgumentException("Field " + toString() + " is not accessible", e);
/** Get the names of any classes referenced in the annotation parameters. */ @Override void getReferencedClassNames(final Set<String> referencedClassNames) { if (enumValue != null) { enumValue.getReferencedClassNames(referencedClassNames); } else if (classRef != null) { referencedClassNames.add(classRef.getClassName()); } else if (annotationInfo != null) { annotationInfo.getReferencedClassNames(referencedClassNames); } else if (objectArrayValue != null) { for (final ObjectTypedValueWrapper item : objectArrayValue) { item.getReferencedClassNames(referencedClassNames); } } } }
@Override void setScanResult(final ScanResult scanResult) { super.setScanResult(scanResult); if (enumValue != null) { enumValue.setScanResult(scanResult); } else if (classRef != null) { classRef.setScanResult(scanResult); } else if (annotationInfo != null) { annotationInfo.setScanResult(scanResult); } else if (objectArrayValue != null) { for (final ObjectTypedValueWrapper anObjectArrayValue : objectArrayValue) { if (anObjectArrayValue != null) { anObjectArrayValue.setScanResult(scanResult); } } } }
return new AnnotationEnumValue(className, constName);
final boolean instantiate = annotationClassInfo != null; if (enumValue != null) { return instantiate ? enumValue.loadClassAndReturnEnumValue() : enumValue; } else if (classRef != null) { return instantiate ? classRef.loadClass() : classRef;