Package io.github.classgraph
Class AnnotationEnumValue
- java.lang.Object
-
- io.github.classgraph.ScanResultObject
-
- io.github.classgraph.AnnotationEnumValue
-
- All Implemented Interfaces:
java.lang.Comparable<AnnotationEnumValue>
public class AnnotationEnumValue extends ScanResultObject implements java.lang.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 private java.lang.StringclassNameThe class name.private java.lang.StringvalueNameThe value name.-
Fields inherited from class io.github.classgraph.ScanResultObject
classRef, scanResult
-
-
Constructor Summary
Constructors Constructor Description AnnotationEnumValue()Default constructor for deserialization.AnnotationEnumValue(java.lang.String className, java.lang.String constValueName)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(AnnotationEnumValue o)booleanequals(java.lang.Object obj)java.lang.StringgetClassName()Get the class name.java.lang.StringgetName()Get the name.java.lang.StringgetValueName()Get the value name.inthashCode()java.lang.ObjectloadClassAndReturnEnumValue()Loads the enum class, instantiates the enum constants for the class, and returns the enum constant value represented by thisAnnotationEnumValue.java.lang.ObjectloadClassAndReturnEnumValue(boolean ignoreExceptions)Loads the enum class, instantiates the enum constants for the class, and returns the enum constant value represented by thisAnnotationEnumValue.protected voidtoString(boolean useSimpleNames, java.lang.StringBuilder buf)Render to string.-
Methods inherited from class io.github.classgraph.ScanResultObject
findReferencedClassInfo, findReferencedClassInfo, getClassInfo, loadClass, loadClass, loadClass, loadClass, setScanResult, toString, toString, toStringWithSimpleNames
-
-
-
-
Constructor Detail
-
AnnotationEnumValue
AnnotationEnumValue()
Default constructor for deserialization.
-
AnnotationEnumValue
AnnotationEnumValue(java.lang.String className, java.lang.String constValueName)Constructor.- Parameters:
className- The enum class name.constValueName- The enum const value name.
-
-
Method Detail
-
getClassName
public java.lang.String getClassName()
Get the class name.- Specified by:
getClassNamein classScanResultObject- Returns:
- The name of the enum class.
-
getValueName
public java.lang.String getValueName()
Get the value name.- Returns:
- The name of the enum const value.
-
getName
public java.lang.String getName()
Get the name.- Returns:
- The fully-qualified name of the enum constant value, i.e. (
getClassName()+ {#getValueName()}).
-
loadClassAndReturnEnumValue
public java.lang.Object loadClassAndReturnEnumValue(boolean ignoreExceptions) throws java.lang.IllegalArgumentExceptionLoads 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:
java.lang.IllegalArgumentException- if the class could not be loaded and ignoreExceptions was false, or if the enum constant is invalid.
-
loadClassAndReturnEnumValue
public java.lang.Object loadClassAndReturnEnumValue() throws java.lang.IllegalArgumentExceptionLoads 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:
java.lang.IllegalArgumentException- if the class could not be loaded, or the enum constant is invalid.
-
compareTo
public int compareTo(AnnotationEnumValue o)
- Specified by:
compareToin interfacejava.lang.Comparable<AnnotationEnumValue>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
protected void toString(boolean useSimpleNames, java.lang.StringBuilder buf)Description copied from class:ScanResultObjectRender to string.- Specified by:
toStringin classScanResultObject- Parameters:
useSimpleNames- if true, use just the simple name of each class.buf- the buf
-
-