Class AnnotationEnumValue
java.lang.Object
io.github.classgraph.AnnotationEnumValue
- All Implemented Interfaces:
Comparable<AnnotationEnumValue>
Class for wrapping an enum constant value (split into class name and constant name), as used as an annotation
parameter value.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Class<?> The class ref, once the class is loaded.protected ScanResultThe scan result. -
Method Summary
Modifier and TypeMethodDescriptionintbooleanprotected voidfindReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, nonapi.io.github.classgraph.utils.LogNode log) GetClassInfoobjects for any classes referenced by this object.Get the class name.getName()Get the name.Get the value name.inthashCode()Loads the enum class, instantiates the enum constants for the class, and returns the enum constant value represented by thisAnnotationEnumValue.loadClassAndReturnEnumValue(boolean ignoreExceptions) Loads the enum class, instantiates the enum constants for the class, and returns the enum constant value represented by thisAnnotationEnumValue.toString()Render to string.protected voidtoString(boolean useSimpleNames, StringBuilder buf) Render to string.Render to string, using only simple names for classes.
-
Field Details
-
scanResult
The scan result. -
classRef
The class ref, once the class is loaded.
-
-
Method Details
-
getClassName
-
getValueName
-
getName
Get the name.- Returns:
- The fully-qualified name of the enum constant value, i.e. (
getClassName()+ {#getValueName()}).
-
loadClassAndReturnEnumValue
Loads the enum class, instantiates the enum constants for the class, and returns the enum constant value represented by thisAnnotationEnumValue.- Parameters:
ignoreExceptions- If true, ignore classloading exceptions and return null on failure.- Returns:
- The enum constant value represented by this
AnnotationEnumValue - Throws:
IllegalArgumentException- if the class could not be loaded and ignoreExceptions was false, or if the enum constant is invalid.
-
loadClassAndReturnEnumValue
Loads the enum class, instantiates the enum constants for the class, and returns the enum constant value represented by thisAnnotationEnumValue.- Returns:
- The enum constant value represented by this
AnnotationEnumValue - Throws:
IllegalArgumentException- if the class could not be loaded, or the enum constant is invalid.
-
compareTo
- Specified by:
compareToin interfaceComparable<AnnotationEnumValue>
-
equals
-
hashCode
-
toString
Render to string.- Parameters:
useSimpleNames- if true, use just the simple name of each class.buf- the buf
-
findReferencedClassInfo
protected void findReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, nonapi.io.github.classgraph.utils.LogNode log) GetClassInfoobjects for any classes referenced by this object.- Parameters:
classNameToClassInfo- the map from class name toClassInfo.refdClassInfo- the referenced class infolog- the log
-
toStringWithSimpleNames
Render to string, using only simple names for classes.- Returns:
- the string representation, using simple names for classes.
-
toString
-