Class MemberInfo

java.lang.Object
com.strobel.reflection.MemberInfo
All Implemented Interfaces:
AnnotatedElement
Direct Known Subclasses:
FieldInfo, MethodBase, Type

public abstract class MemberInfo extends Object implements AnnotatedElement
  • Field Details

    • EMPTY_ANNOTATIONS

      static final Annotation[] EMPTY_ANNOTATIONS
    • ENUM_MODIFIER

      static final int ENUM_MODIFIER
      See Also:
    • VARARGS_MODIFIER

      static final int VARARGS_MODIFIER
      See Also:
    • _signature

      private String _signature
    • _erasedSignature

      private String _erasedSignature
    • _description

      private String _description
    • _erasedDescription

      private String _erasedDescription
    • _briefDescription

      private String _briefDescription
    • _simpleDescription

      private String _simpleDescription
  • Constructor Details

    • MemberInfo

      MemberInfo()
  • Method Details

    • emptyAnnotations

      public static Annotation[] emptyAnnotations()
    • getMemberType

      public abstract MemberType getMemberType()
    • getName

      public abstract String getName()
    • getDeclaringType

      public abstract Type<?> getDeclaringType()
    • getReflectedType

      public Type<?> getReflectedType()
    • isFinal

      public final boolean isFinal()
    • isNonPublic

      public final boolean isNonPublic()
    • isPrivate

      public final boolean isPrivate()
    • isProtected

      public final boolean isProtected()
    • isPublic

      public final boolean isPublic()
    • isStatic

      public final boolean isStatic()
    • isPackagePrivate

      public final boolean isPackagePrivate()
    • getModifiers

      public abstract int getModifiers()
    • isAnnotationPresent

      public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
      Specified by:
      isAnnotationPresent in interface AnnotatedElement
    • getAnnotation

      public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
      Specified by:
      getAnnotation in interface AnnotatedElement
    • getAnnotations

      @NotNull public Annotation[] getAnnotations()
      Specified by:
      getAnnotations in interface AnnotatedElement
    • getDeclaredAnnotations

      @NotNull public Annotation[] getDeclaredAnnotations()
      Specified by:
      getDeclaredAnnotations in interface AnnotatedElement
    • getDeclaredAnnotation

      public <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass)
      Specified by:
      getDeclaredAnnotation in interface AnnotatedElement
    • getAnnotationsByType

      public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass)
      Specified by:
      getAnnotationsByType in interface AnnotatedElement
    • getDeclaredAnnotationsByType

      public <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass)
      Specified by:
      getDeclaredAnnotationsByType in interface AnnotatedElement
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public boolean isEquivalentTo(MemberInfo m)
    • getSignature

      public String getSignature()
      Method that returns full generic signature of a type or member.
    • getErasedSignature

      public String getErasedSignature()
      Method that returns type erased signature of a type or member; suitable as non-generic signature some packages need.
    • getBriefDescription

      public String getBriefDescription()
      Human-readable brief description of a type or member, which does not include information super types, thrown exceptions, or modifiers other than 'static'.
    • getDescription

      public String getDescription()
      Human-readable full description of a type or member, which includes specification of super types (in brief format), thrown exceptions, and modifiers.
    • getErasedDescription

      public String getErasedDescription()
      Human-readable erased description of a type or member.
    • getSimpleDescription

      public String getSimpleDescription()
      Human-readable simple description of a type or member, which does not include information super type or fully-qualified type names.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • appendDescription

      public abstract StringBuilder appendDescription(StringBuilder sb)
    • appendBriefDescription

      public abstract StringBuilder appendBriefDescription(StringBuilder sb)
    • appendErasedDescription

      public abstract StringBuilder appendErasedDescription(StringBuilder sb)
    • appendSignature

      public abstract StringBuilder appendSignature(StringBuilder sb)
    • appendErasedSignature

      public abstract StringBuilder appendErasedSignature(StringBuilder sb)
    • appendSimpleDescription

      public abstract StringBuilder appendSimpleDescription(StringBuilder sb)
    • appendGenericSignature

      public StringBuilder appendGenericSignature(StringBuilder sb)
    • invalidateCaches

      protected void invalidateCaches()
      Invalidate any cached type/member information. This is not guaranteed to be thread-safe, should only be called when a partially constructed type/member definition changes (e.g., a TypeBuilder, MethodBuilder, etc.).