Package io.github.classgraph
Class AnnotationEnumValue
- java.lang.Object
-
- io.github.classgraph.AnnotationEnumValue
-
- All Implemented Interfaces:
Comparable<AnnotationEnumValue>
public class AnnotationEnumValue extends Object implements 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
Fields Modifier and Type Field Description protected ScanResultscanResult
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(AnnotationEnumValue o)booleanequals(Object o)StringgetClassName()The name of the class (used bygetClassInfo()to fetch theClassInfoobject for the class).StringgetName()StringgetValueName()inthashCode()ObjectloadClassAndReturnEnumValue()Loads the enum class, instantiates the enum constants for the class, and returns the enum constant value represented by thisAnnotationEnumValue.ObjectloadClassAndReturnEnumValue(boolean ignoreExceptions)Loads the enum class, instantiates the enum constants for the class, and returns the enum constant value represented by thisAnnotationEnumValue.StringtoString()
-
-
-
Field Detail
-
scanResult
protected transient ScanResult scanResult
-
-
Method Detail
-
getClassName
public String getClassName()
The name of the class (used bygetClassInfo()to fetch theClassInfoobject for the class).- Returns:
- The name of the enum class.
-
getValueName
public String getValueName()
- Returns:
- The name of the enum const value.
-
getName
public String getName()
- Returns:
- The fully-qualified name of the enum constant value, i.e. (
getClassName()+ {#getValueName()}).
-
loadClassAndReturnEnumValue
public Object loadClassAndReturnEnumValue(boolean ignoreExceptions) throws IllegalArgumentException
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
public Object loadClassAndReturnEnumValue() throws IllegalArgumentException
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
public int compareTo(AnnotationEnumValue o)
- Specified by:
compareToin interfaceComparable<AnnotationEnumValue>
-
-