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 ScanResult
scanResult
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(AnnotationEnumValue o)
boolean
equals(Object o)
String
getClassName()
The name of the class (used bygetClassInfo()
to fetch theClassInfo
object for the class).String
getName()
String
getValueName()
int
hashCode()
Object
loadClassAndReturnEnumValue()
Loads the enum class, instantiates the enum constants for the class, and returns the enum constant value represented by thisAnnotationEnumValue
.Object
loadClassAndReturnEnumValue(boolean ignoreExceptions)
Loads the enum class, instantiates the enum constants for the class, and returns the enum constant value represented by thisAnnotationEnumValue
.String
toString()
-
-
-
Field Detail
-
scanResult
protected transient ScanResult scanResult
-
-
Method Detail
-
getClassName
public String getClassName()
The name of the class (used bygetClassInfo()
to fetch theClassInfo
object 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:
compareTo
in interfaceComparable<AnnotationEnumValue>
-
-