Package com.strobel.reflection
Class MemberInfo
- java.lang.Object
-
- com.strobel.reflection.MemberInfo
-
- All Implemented Interfaces:
java.lang.reflect.AnnotatedElement
- Direct Known Subclasses:
FieldInfo,MethodBase,Type
public abstract class MemberInfo extends java.lang.Object implements java.lang.reflect.AnnotatedElement
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String_briefDescriptionprivate java.lang.String_descriptionprivate java.lang.String_erasedDescriptionprivate java.lang.String_erasedSignatureprivate java.lang.String_signatureprivate java.lang.String_simpleDescription(package private) static java.lang.annotation.Annotation[]EMPTY_ANNOTATIONS(package private) static intENUM_MODIFIER(package private) static intVARARGS_MODIFIER
-
Constructor Summary
Constructors Constructor Description MemberInfo()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.StringBuilderappendBriefDescription(java.lang.StringBuilder sb)abstract java.lang.StringBuilderappendDescription(java.lang.StringBuilder sb)abstract java.lang.StringBuilderappendErasedDescription(java.lang.StringBuilder sb)abstract java.lang.StringBuilderappendErasedSignature(java.lang.StringBuilder sb)java.lang.StringBuilderappendGenericSignature(java.lang.StringBuilder sb)abstract java.lang.StringBuilderappendSignature(java.lang.StringBuilder sb)abstract java.lang.StringBuilderappendSimpleDescription(java.lang.StringBuilder sb)static java.lang.annotation.Annotation[]emptyAnnotations()booleanequals(java.lang.Object o)<T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> annotationClass)java.lang.annotation.Annotation[]getAnnotations()<T extends java.lang.annotation.Annotation>
T[]getAnnotationsByType(java.lang.Class<T> annotationClass)java.lang.StringgetBriefDescription()Human-readable brief description of a type or member, which does not include information super types, thrown exceptions, or modifiers other than 'static'.<T extends java.lang.annotation.Annotation>
TgetDeclaredAnnotation(java.lang.Class<T> annotationClass)java.lang.annotation.Annotation[]getDeclaredAnnotations()<T extends java.lang.annotation.Annotation>
T[]getDeclaredAnnotationsByType(java.lang.Class<T> annotationClass)abstract Type<?>getDeclaringType()java.lang.StringgetDescription()Human-readable full description of a type or member, which includes specification of super types (in brief format), thrown exceptions, and modifiers.java.lang.StringgetErasedDescription()Human-readable erased description of a type or member.java.lang.StringgetErasedSignature()Method that returns type erased signature of a type or member; suitable as non-generic signature some packages need.abstract MemberTypegetMemberType()abstract intgetModifiers()abstract java.lang.StringgetName()Type<?>getReflectedType()java.lang.StringgetSignature()Method that returns full generic signature of a type or member.java.lang.StringgetSimpleDescription()Human-readable simple description of a type or member, which does not include information super type or fully-qualified type names.inthashCode()protected voidinvalidateCaches()Invalidate any cached type/member information.booleanisAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)booleanisEquivalentTo(MemberInfo m)booleanisFinal()booleanisNonPublic()booleanisPackagePrivate()booleanisPrivate()booleanisProtected()booleanisPublic()booleanisStatic()java.lang.StringtoString()
-
-
-
Field Detail
-
EMPTY_ANNOTATIONS
static final java.lang.annotation.Annotation[] EMPTY_ANNOTATIONS
-
ENUM_MODIFIER
static final int ENUM_MODIFIER
- See Also:
- Constant Field Values
-
VARARGS_MODIFIER
static final int VARARGS_MODIFIER
- See Also:
- Constant Field Values
-
_signature
private java.lang.String _signature
-
_erasedSignature
private java.lang.String _erasedSignature
-
_description
private java.lang.String _description
-
_erasedDescription
private java.lang.String _erasedDescription
-
_briefDescription
private java.lang.String _briefDescription
-
_simpleDescription
private java.lang.String _simpleDescription
-
-
Method Detail
-
emptyAnnotations
public static java.lang.annotation.Annotation[] emptyAnnotations()
-
getMemberType
public abstract MemberType getMemberType()
-
getName
public abstract java.lang.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(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
- Specified by:
isAnnotationPresentin interfacejava.lang.reflect.AnnotatedElement
-
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
- Specified by:
getAnnotationin interfacejava.lang.reflect.AnnotatedElement
-
getAnnotations
@NotNull public java.lang.annotation.Annotation[] getAnnotations()
- Specified by:
getAnnotationsin interfacejava.lang.reflect.AnnotatedElement
-
getDeclaredAnnotations
@NotNull public java.lang.annotation.Annotation[] getDeclaredAnnotations()
- Specified by:
getDeclaredAnnotationsin interfacejava.lang.reflect.AnnotatedElement
-
getDeclaredAnnotation
public <T extends java.lang.annotation.Annotation> T getDeclaredAnnotation(java.lang.Class<T> annotationClass)
- Specified by:
getDeclaredAnnotationin interfacejava.lang.reflect.AnnotatedElement
-
getAnnotationsByType
public <T extends java.lang.annotation.Annotation> T[] getAnnotationsByType(java.lang.Class<T> annotationClass)
- Specified by:
getAnnotationsByTypein interfacejava.lang.reflect.AnnotatedElement
-
getDeclaredAnnotationsByType
public <T extends java.lang.annotation.Annotation> T[] getDeclaredAnnotationsByType(java.lang.Class<T> annotationClass)
- Specified by:
getDeclaredAnnotationsByTypein interfacejava.lang.reflect.AnnotatedElement
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
isEquivalentTo
public boolean isEquivalentTo(MemberInfo m)
-
getSignature
public java.lang.String getSignature()
Method that returns full generic signature of a type or member.
-
getErasedSignature
public java.lang.String getErasedSignature()
Method that returns type erased signature of a type or member; suitable as non-generic signature some packages need.
-
getBriefDescription
public java.lang.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 java.lang.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 java.lang.String getErasedDescription()
Human-readable erased description of a type or member.
-
getSimpleDescription
public java.lang.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 java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
appendDescription
public abstract java.lang.StringBuilder appendDescription(java.lang.StringBuilder sb)
-
appendBriefDescription
public abstract java.lang.StringBuilder appendBriefDescription(java.lang.StringBuilder sb)
-
appendErasedDescription
public abstract java.lang.StringBuilder appendErasedDescription(java.lang.StringBuilder sb)
-
appendSignature
public abstract java.lang.StringBuilder appendSignature(java.lang.StringBuilder sb)
-
appendErasedSignature
public abstract java.lang.StringBuilder appendErasedSignature(java.lang.StringBuilder sb)
-
appendSimpleDescription
public abstract java.lang.StringBuilder appendSimpleDescription(java.lang.StringBuilder sb)
-
appendGenericSignature
public java.lang.StringBuilder appendGenericSignature(java.lang.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.).
-
-