public abstract class ClassMemberInfo extends Object implements HasName
Constructor and Description |
---|
ClassMemberInfo(String definingClassName,
String memberName,
int modifiers,
String typeDescriptorStr,
String typeSignatureStr,
AnnotationInfoList annotationInfo)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
AnnotationInfoList |
getAnnotationInfo()
Get a list of annotations on this class member, along with any annotation parameter values, wrapped in
AnnotationInfo objects. |
AnnotationInfo |
getAnnotationInfo(Class<? extends Annotation> annotation)
Get a the non-
Repeatable annotation on this class member, or null if the class member does not have
the annotation. |
AnnotationInfo |
getAnnotationInfo(String annotationName)
Get a the named non-
Repeatable annotation on this class member, or null if the class member does not
have the named annotation. |
AnnotationInfoList |
getAnnotationInfoRepeatable(Class<? extends Annotation> annotation)
Get a the
Repeatable annotation on this class member, or the empty list if the class member does not
have the annotation. |
AnnotationInfoList |
getAnnotationInfoRepeatable(String annotationName)
Get a the named
Repeatable annotation on this class member, or the empty list if the class member
does not have the named annotation. |
ClassInfo |
getClassInfo()
Get the
ClassInfo object for the class that declares this class member. |
String |
getClassName()
Get the name of the class that declares this member.
|
int |
getModifiers()
Returns the modifier bits for the class member.
|
abstract String |
getModifiersStr()
Get the modifiers as a string, e.g.
|
String |
getName()
Get the name of the class member.
|
abstract HierarchicalTypeSignature |
getTypeDescriptor()
Returns the parsed type descriptor for the class member, which will not include type parameters.
|
String |
getTypeDescriptorStr()
Returns the type descriptor string for the class member, which will not include type parameters.
|
abstract HierarchicalTypeSignature |
getTypeSignature()
Returns the parsed type signature for the class member, possibly including type parameters.
|
abstract HierarchicalTypeSignature |
getTypeSignatureOrTypeDescriptor()
Returns the type signature for the class member, possibly including type parameters.
|
String |
getTypeSignatureOrTypeDescriptorStr()
Returns the type signature string for the class member, possibly including type parameters.
|
String |
getTypeSignatureStr()
Returns the type signature string for the class member, possibly including type parameters.
|
boolean |
hasAnnotation(Class<? extends Annotation> annotation)
Check if the class member has a given annotation.
|
boolean |
hasAnnotation(String annotationName)
Check if the class member has a given named annotation.
|
boolean |
isFinal()
Returns true if this class member is final.
|
boolean |
isPrivate()
Returns true if this class member is private.
|
boolean |
isProtected()
Returns true if this class member is protected.
|
boolean |
isPublic()
Returns true if this class member is public.
|
boolean |
isStatic()
Returns true if this class member is static.
|
boolean |
isSynthetic()
Returns true if this class member is synthetic.
|
String |
toString()
Render to string.
|
String |
toStringWithSimpleNames()
Render to string, using only simple
names for classes.
|
public ClassMemberInfo(String definingClassName, String memberName, int modifiers, String typeDescriptorStr, String typeSignatureStr, AnnotationInfoList annotationInfo)
definingClassName
- The class the member is defined within.memberName
- The name of the class member.modifiers
- The class member modifiers.typeDescriptorStr
- The class member type descriptor.typeSignatureStr
- The class member type signature.annotationInfo
- AnnotationInfo
for any annotations on the class member.public ClassInfo getClassInfo()
ClassInfo
object for the class that declares this class member.ClassInfo
object for the declaring class.getClassName()
public String getClassName()
getClassInfo()
public String getName()
public int getModifiers()
public abstract String getModifiersStr()
public boolean isPublic()
public boolean isPrivate()
public boolean isProtected()
public boolean isStatic()
public boolean isFinal()
public boolean isSynthetic()
public abstract HierarchicalTypeSignature getTypeDescriptor()
getTypeSignature()
instead.public String getTypeDescriptorStr()
getTypeSignatureStr()
instead.public abstract HierarchicalTypeSignature getTypeSignature()
getTypeDescriptor()
instead.IllegalArgumentException
- if the class member type signature cannot be parsed (this should only be thrown in the case of
classfile corruption, or a compiler bug that causes an invalid type signature to be written to
the classfile).public String getTypeSignatureStr()
getTypeDescriptorStr()
instead.public abstract HierarchicalTypeSignature getTypeSignatureOrTypeDescriptor()
public String getTypeSignatureOrTypeDescriptorStr()
public AnnotationInfoList getAnnotationInfo()
AnnotationInfo
objects.AnnotationInfo
objects, or the empty list if none.public AnnotationInfo getAnnotationInfo(Class<? extends Annotation> annotation)
Repeatable
annotation on this class member, or null if the class member does not have
the annotation. (Use getAnnotationInfoRepeatable(Class)
for Repeatable
annotations.)annotation
- The annotation.AnnotationInfo
object representing the annotation on this class member, or null if the
class member does not have the annotation.public AnnotationInfo getAnnotationInfo(String annotationName)
Repeatable
annotation on this class member, or null if the class member does not
have the named annotation. (Use getAnnotationInfoRepeatable(String)
for Repeatable
annotations.)annotationName
- The annotation name.AnnotationInfo
object representing the named annotation on this class member, or null if
the class member does not have the named annotation.public AnnotationInfoList getAnnotationInfoRepeatable(Class<? extends Annotation> annotation)
Repeatable
annotation on this class member, or the empty list if the class member does not
have the annotation.annotation
- The annotation.AnnotationInfoList
of all instances of the annotation on this class member, or the empty
list if the class member does not have the annotation.public AnnotationInfoList getAnnotationInfoRepeatable(String annotationName)
Repeatable
annotation on this class member, or the empty list if the class member
does not have the named annotation.annotationName
- The annotation name.AnnotationInfoList
of all instances of the named annotation on this class member, or the
empty list if the class member does not have the named annotation.public boolean hasAnnotation(Class<? extends Annotation> annotation)
annotation
- The annotation.public boolean hasAnnotation(String annotationName)
annotationName
- The name of an annotation.public String toStringWithSimpleNames()
Copyright © 2023. All rights reserved.