Package io.github.classgraph
Class AnnotationEnumValue
java.lang.Object
io.github.classgraph.ScanResultObject
io.github.classgraph.AnnotationEnumValue
- All Implemented Interfaces:
Comparable<AnnotationEnumValue>
public class AnnotationEnumValue
extends ScanResultObject
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
FieldsFields inherited from class io.github.classgraph.ScanResultObject
classRef, scanResult -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for deserialization.AnnotationEnumValue(String className, String constValueName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintbooleanGet 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.protected voidtoString(boolean useSimpleNames, StringBuilder buf) Render to string.Methods inherited from class io.github.classgraph.ScanResultObject
findReferencedClassInfo, findReferencedClassInfo, getClassInfo, loadClass, loadClass, loadClass, loadClass, setScanResult, toString, toString, toStringWithSimpleNames
-
Field Details
-
className
The class name. -
valueName
The value name.
-
-
Constructor Details
-
AnnotationEnumValue
AnnotationEnumValue()Default constructor for deserialization. -
AnnotationEnumValue
Constructor.- Parameters:
className- The enum class name.constValueName- The enum const value name.
-
-
Method Details
-
getClassName
Get the class name.- Specified by:
getClassNamein classScanResultObject- Returns:
- The name of the enum class.
-
getValueName
Get the value name.- Returns:
- The name of the enum const value.
-
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
public int hashCode() -
toString
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
-