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
_briefDescription
private java.lang.String
_description
private java.lang.String
_erasedDescription
private java.lang.String
_erasedSignature
private java.lang.String
_signature
private java.lang.String
_simpleDescription
(package private) static java.lang.annotation.Annotation[]
EMPTY_ANNOTATIONS
(package private) static int
ENUM_MODIFIER
(package private) static int
VARARGS_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.StringBuilder
appendBriefDescription(java.lang.StringBuilder sb)
abstract java.lang.StringBuilder
appendDescription(java.lang.StringBuilder sb)
abstract java.lang.StringBuilder
appendErasedDescription(java.lang.StringBuilder sb)
abstract java.lang.StringBuilder
appendErasedSignature(java.lang.StringBuilder sb)
java.lang.StringBuilder
appendGenericSignature(java.lang.StringBuilder sb)
abstract java.lang.StringBuilder
appendSignature(java.lang.StringBuilder sb)
abstract java.lang.StringBuilder
appendSimpleDescription(java.lang.StringBuilder sb)
static java.lang.annotation.Annotation[]
emptyAnnotations()
boolean
equals(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.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'.<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.String
getDescription()
Human-readable full description of a type or member, which includes specification of super types (in brief format), thrown exceptions, and modifiers.java.lang.String
getErasedDescription()
Human-readable erased description of a type or member.java.lang.String
getErasedSignature()
Method that returns type erased signature of a type or member; suitable as non-generic signature some packages need.abstract MemberType
getMemberType()
abstract int
getModifiers()
abstract java.lang.String
getName()
Type<?>
getReflectedType()
java.lang.String
getSignature()
Method that returns full generic signature of a type or member.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.int
hashCode()
protected void
invalidateCaches()
Invalidate any cached type/member information.boolean
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
boolean
isEquivalentTo(MemberInfo m)
boolean
isFinal()
boolean
isNonPublic()
boolean
isPackagePrivate()
boolean
isPrivate()
boolean
isProtected()
boolean
isPublic()
boolean
isStatic()
java.lang.String
toString()
-
-
-
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:
isAnnotationPresent
in interfacejava.lang.reflect.AnnotatedElement
-
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
- Specified by:
getAnnotation
in interfacejava.lang.reflect.AnnotatedElement
-
getAnnotations
@NotNull public java.lang.annotation.Annotation[] getAnnotations()
- Specified by:
getAnnotations
in interfacejava.lang.reflect.AnnotatedElement
-
getDeclaredAnnotations
@NotNull public java.lang.annotation.Annotation[] getDeclaredAnnotations()
- Specified by:
getDeclaredAnnotations
in interfacejava.lang.reflect.AnnotatedElement
-
getDeclaredAnnotation
public <T extends java.lang.annotation.Annotation> T getDeclaredAnnotation(java.lang.Class<T> annotationClass)
- Specified by:
getDeclaredAnnotation
in interfacejava.lang.reflect.AnnotatedElement
-
getAnnotationsByType
public <T extends java.lang.annotation.Annotation> T[] getAnnotationsByType(java.lang.Class<T> annotationClass)
- Specified by:
getAnnotationsByType
in interfacejava.lang.reflect.AnnotatedElement
-
getDeclaredAnnotationsByType
public <T extends java.lang.annotation.Annotation> T[] getDeclaredAnnotationsByType(java.lang.Class<T> annotationClass)
- Specified by:
getDeclaredAnnotationsByType
in interfacejava.lang.reflect.AnnotatedElement
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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:
toString
in 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.).
-
-