Class AnnotationClassRef

java.lang.Object
io.github.classgraph.AnnotationClassRef

public class AnnotationClassRef extends Object
Stores the type descriptor of a Class<?>, as found in an annotation parameter value.
  • Method Details

    • getName

      public String getName()
      Get the name of the referenced class.
      Returns:
      The name of the referenced class.
    • loadClass

      public Class<?> loadClass(boolean ignoreExceptions)
      Loads the referenced class, returning a Class<?> reference for the referenced class.
      Parameters:
      ignoreExceptions - if true, ignore exceptions and instead return null if the class could not be loaded.
      Returns:
      The Class<?> reference for the referenced class.
      Throws:
      IllegalArgumentException - if the class could not be loaded and ignoreExceptions was false.
    • loadClass

      public Class<?> loadClass()
      Loads the referenced class, returning a Class<?> reference for the referenced class.
      Returns:
      The Class<?> reference for the referenced class.
      Throws:
      IllegalArgumentException - if the class could not be loaded.
    • getClassInfo

      public ClassInfo getClassInfo()
      Get the class info.
      Returns:
      The ClassInfo object for the referenced class, or null if the referenced class was not encountered during scanning (i.e. if no ClassInfo object was created for the class during scanning). N.B. even if this method returns null, loadClass() may be able to load the referenced class by name.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toStringWithSimpleNames

      public String toStringWithSimpleNames()
      Render to string, using only simple names for classes.
      Returns:
      the string representation, using simple names for classes.
    • toString

      public String toString()
      Render to string.
      Overrides:
      toString in class Object
      Returns:
      the string representation.