Top Description Fields Constructors Methods
io.github.classgraph

public abstract Class ClassMemberInfo

extends ScanResultObject
implements HasName
Class Inheritance
All Implemented Interfaces
io.github.classgraph.HasName
Known Direct Subclasses
io.github.classgraph.MethodInfo, io.github.classgraph.FieldInfo
Imports
java.lang.annotation.Annotation, .Repeatable, java.lang.reflect.Modifier, nonapi.io.github.classgraph.utils.Assert

Holds metadata about class members of a class encountered during a scan. All values are taken directly out of the classfile for the class.

Field Summary

Modifier and TypeField and Description
protected AnnotationInfoList
annotationInfo

The annotation on the class member, if any.

private AnnotationInfoList
annotationInfoRef

The annotation infos, once they are loaded

protected String
declaringClassName

Defining class name.

protected int
modifiers

Class member modifiers.

protected String
name

The name of the class member.

protected String
typeDescriptorStr

The JVM-internal type descriptor (missing type parameters, but including types for synthetic and mandated class member parameters).

protected String
typeSignatureStr

The type signature (may have type parameter information included, if present and available).

Inherited from io.github.classgraph.ScanResultObject:
classRefscanResult

Constructor Summary

AccessConstructor and Description
pack-priv
ClassMemberInfo()

Default constructor for deserialization.

public
ClassMemberInfo(final String
The class the member is defined within.
definingClassName
,
final String
The name of the class member.
memberName
,
final int
The class member modifiers.
modifiers
,
final String
The class member type descriptor.
typeDescriptorStr
,
final String
The class member type signature.
typeSignatureStr
,
final AnnotationInfoList
AnnotationInfo for any annotations on the class member.
annotationInfo
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public AnnotationInfoList

Returns:

A list of annotations on this class member, along with any annotation parameter values, wrapped in AnnotationInfo objects, or the empty list if none.
getAnnotationInfo
()

Get a list of annotations on this class member, along with any annotation parameter values, wrapped in AnnotationInfo objects.

public AnnotationInfo

Returns:

An AnnotationInfo object representing the annotation on this class member, or null if the class member does not have the annotation.
getAnnotationInfo
(final Class<? extends Annotation>
The annotation.
annotation
)

Get a the non-Repeatable annotation on this class member, or null if the class member does not have the annotation.

public AnnotationInfo

Returns:

An AnnotationInfo object representing the named annotation on this class member, or null if the class member does not have the named annotation.
getAnnotationInfo
(final String
The annotation name.
annotationName
)

Get a the named non-Repeatable annotation on this class member, or null if the class member does not have the named annotation.

public AnnotationInfoList

Returns:

An AnnotationInfoList of all instances of the annotation on this class member, or the empty list if the class member does not have the annotation.
getAnnotationInfoRepeatable
(final Class<? extends Annotation>
The annotation.
annotation
)

Get a the Repeatable annotation on this class member, or the empty list if the class member does not have the annotation.

public AnnotationInfoList

Returns:

An 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.
getAnnotationInfoRepeatable
(final String
The annotation name.
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.

public ClassInfo

Returns:

The ClassInfo object for the declaring class.
getClassInfo
()

Overrides io.github.classgraph.ScanResultObject.getClassInfo.

Get the ClassInfo object for the class that declares this class member.

public String

Returns:

The name of the declaring class.
getClassName
()

Implements abstract io.github.classgraph.ScanResultObject.getClassName.

Get the name of the class that declares this member.

public int

Returns:

The modifier bits for the class member.
getModifiers
()

Returns the modifier bits for the class member.

public abstract String

Returns:

The modifiers modifiers, as a string.
getModifiersStr
()

Get the modifiers as a string, e.g. "public static final".

public String

Returns:

The name of the class member.
getName
()

Implements io.github.classgraph.HasName.getName.

Get the name of the class member.

public abstract HierarchicalTypeSignature

Returns:

The parsed type descriptor string for the class member.
getTypeDescriptor
()

Returns the parsed type descriptor for the class member, which will not include type parameters.

public String

Returns:

The type descriptor string for the class member.
getTypeDescriptorStr
()

Returns the type descriptor string for the class member, which will not include type parameters.

public abstract HierarchicalTypeSignature

Returns:

The parsed type signature for the class member, or null if not available.
getTypeSignature
()

Returns the parsed type signature for the class member, possibly including type parameters.

public abstract HierarchicalTypeSignature

Returns:

The parsed type signature for the class member, or if not available, the parsed type descriptor for the class member.
getTypeSignatureOrTypeDescriptor
()

Returns the type signature for the class member, possibly including type parameters.

public String

Returns:

The type signature string for the class member, or if not available, the type descriptor string for the class member.
getTypeSignatureOrTypeDescriptorStr
()

Returns the type signature string for the class member, possibly including type parameters.

public String

Returns:

The type signature string for the class member, or null if not available.
getTypeSignatureStr
()

Returns the type signature string for the class member, possibly including type parameters.

public boolean

Returns:

true if this class member has the annotation.
hasAnnotation
(final Class<? extends Annotation>
The annotation.
annotation
)

Check if the class member has a given annotation.

public boolean

Returns:

true if this class member has the named annotation.
hasAnnotation
(final String
The name of an annotation.
annotationName
)

Check if the class member has a given named annotation.

public boolean

Returns:

True if the class member is final.
isFinal
()

Returns true if this class member is final.

public boolean

Returns:

True if the class member is private.
isPrivate
()

Returns true if this class member is private.

public boolean

Returns:

True if the class member is protected.
isProtected
()

Returns true if this class member is protected.

public boolean

Returns:

True if the class member is public.
isPublic
()

Returns true if this class member is public.

public boolean

Returns:

True if the class member is static.
isStatic
()

Returns true if this class member is static.

public boolean

Returns:

True if the class member is synthetic.
isSynthetic
()

Returns true if this class member is synthetic.

Inherited from io.github.classgraph.ScanResultObject:
findReferencedClassInfofindReferencedClassInfoloadClassloadClassloadClassloadClasssetScanResulttoStringtoStringtoStringtoStringWithSimpleNames

Field Detail

annotationInfoback to summary
protected AnnotationInfoList annotationInfo

The annotation on the class member, if any.

annotationInfoRefback to summary
private AnnotationInfoList annotationInfoRef

The annotation infos, once they are loaded

declaringClassNameback to summary
protected String declaringClassName

Defining class name.

modifiersback to summary
protected int modifiers

Class member modifiers.

nameback to summary
protected String name

The name of the class member.

typeDescriptorStrback to summary
protected String typeDescriptorStr

The JVM-internal type descriptor (missing type parameters, but including types for synthetic and mandated class member parameters).

typeSignatureStrback to summary
protected String typeSignatureStr

The type signature (may have type parameter information included, if present and available). Class member parameter types are unaligned.

Constructor Detail

ClassMemberInfoback to summary
pack-priv ClassMemberInfo()

Default constructor for deserialization.

ClassMemberInfoback to summary
public ClassMemberInfo(final String definingClassName, final String memberName, final int modifiers, final String typeDescriptorStr, final String typeSignatureStr, final AnnotationInfoList annotationInfo)

Constructor.

Parameters
definingClassName:String

The class the member is defined within.

memberName:String

The name of the class member.

modifiers:int

The class member modifiers.

typeDescriptorStr:String

The class member type descriptor.

typeSignatureStr:String

The class member type signature.

annotationInfo:AnnotationInfoList

AnnotationInfo for any annotations on the class member.

Method Detail

getAnnotationInfoback to summary
public AnnotationInfoList getAnnotationInfo()

Get a list of annotations on this class member, along with any annotation parameter values, wrapped in AnnotationInfo objects.

Returns:AnnotationInfoList

A list of annotations on this class member, along with any annotation parameter values, wrapped in AnnotationInfo objects, or the empty list if none.

getAnnotationInfoback to summary
public AnnotationInfo getAnnotationInfo(final 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. (Use getAnnotationInfoRepeatable(Class) for Repeatable annotations.)

Parameters
annotation:Class<? extends Annotation>

The annotation.

Returns:AnnotationInfo

An AnnotationInfo object representing the annotation on this class member, or null if the class member does not have the annotation.

getAnnotationInfoback to summary
public AnnotationInfo getAnnotationInfo(final 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. (Use getAnnotationInfoRepeatable(String) for Repeatable annotations.)

Parameters
annotationName:String

The annotation name.

Returns:AnnotationInfo

An AnnotationInfo object representing the named annotation on this class member, or null if the class member does not have the named annotation.

getAnnotationInfoRepeatableback to summary
public AnnotationInfoList getAnnotationInfoRepeatable(final 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.

Parameters
annotation:Class<? extends Annotation>

The annotation.

Returns:AnnotationInfoList

An AnnotationInfoList of all instances of the annotation on this class member, or the empty list if the class member does not have the annotation.

getAnnotationInfoRepeatableback to summary
public AnnotationInfoList getAnnotationInfoRepeatable(final 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.

Parameters
annotationName:String

The annotation name.

Returns:AnnotationInfoList

An 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.

getClassInfoback to summary
public ClassInfo getClassInfo()

Overrides io.github.classgraph.ScanResultObject.getClassInfo.

Get the ClassInfo object for the class that declares this class member.

Returns:ClassInfo

The ClassInfo object for the declaring class.

Annotations
@Override
See Also
getClassName()
getClassNameback to summary
public String getClassName()

Implements abstract io.github.classgraph.ScanResultObject.getClassName.

Get the name of the class that declares this member.

Returns:String

The name of the declaring class.

Annotations
@Override
See Also
getClassInfo()
getModifiersback to summary
public int getModifiers()

Returns the modifier bits for the class member.

Returns:int

The modifier bits for the class member.

getModifiersStrback to summary
public abstract String getModifiersStr()

Get the modifiers as a string, e.g. "public static final". For the modifier bits, call getModifiers().

Returns:String

The modifiers modifiers, as a string.

getNameback to summary
public String getName()

Implements io.github.classgraph.HasName.getName.

Get the name of the class member.

Returns:String

The name of the class member.

Annotations
@Override
getTypeDescriptorback to summary
public abstract HierarchicalTypeSignature getTypeDescriptor()

Returns the parsed type descriptor for the class member, which will not include type parameters. If you need generic type parameters, call getTypeSignature() instead.

Returns:HierarchicalTypeSignature

The parsed type descriptor string for the class member.

getTypeDescriptorStrback to summary
public String getTypeDescriptorStr()

Returns the type descriptor string for the class member, which will not include type parameters. If you need generic type parameters, call getTypeSignatureStr() instead.

Returns:String

The type descriptor string for the class member.

getTypeSignatureback to summary
public abstract HierarchicalTypeSignature getTypeSignature()

Returns the parsed type signature for the class member, possibly including type parameters. If this returns null, that no type signature information is available for this class member, call getTypeDescriptor() instead.

Returns:HierarchicalTypeSignature

The parsed type signature for the class member, or null if not available.

Exceptions
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).
getTypeSignatureOrTypeDescriptorback to summary
public abstract HierarchicalTypeSignature getTypeSignatureOrTypeDescriptor()

Returns the type signature for the class member, possibly including type parameters. If the type signature is null, indicating that no type signature information is available for this class member, returns the type descriptor instead.

Returns:HierarchicalTypeSignature

The parsed type signature for the class member, or if not available, the parsed type descriptor for the class member.

getTypeSignatureOrTypeDescriptorStrback to summary
public String getTypeSignatureOrTypeDescriptorStr()

Returns the type signature string for the class member, possibly including type parameters. If the type signature string is null, indicating that no type signature information is available for this class member, returns the type descriptor string instead.

Returns:String

The type signature string for the class member, or if not available, the type descriptor string for the class member.

getTypeSignatureStrback to summary
public String getTypeSignatureStr()

Returns the type signature string for the class member, possibly including type parameters. If this returns null, indicating that no type signature information is available for this class member, call getTypeDescriptorStr() instead.

Returns:String

The type signature string for the class member, or null if not available.

hasAnnotationback to summary
public boolean hasAnnotation(final Class<? extends Annotation> annotation)

Check if the class member has a given annotation.

Parameters
annotation:Class<? extends Annotation>

The annotation.

Returns:boolean

true if this class member has the annotation.

hasAnnotationback to summary
public boolean hasAnnotation(final String annotationName)

Check if the class member has a given named annotation.

Parameters
annotationName:String

The name of an annotation.

Returns:boolean

true if this class member has the named annotation.

isFinalback to summary
public boolean isFinal()

Returns true if this class member is final.

Returns:boolean

True if the class member is final.

isPrivateback to summary
public boolean isPrivate()

Returns true if this class member is private.

Returns:boolean

True if the class member is private.

isProtectedback to summary
public boolean isProtected()

Returns true if this class member is protected.

Returns:boolean

True if the class member is protected.

isPublicback to summary
public boolean isPublic()

Returns true if this class member is public.

Returns:boolean

True if the class member is public.

isStaticback to summary
public boolean isStatic()

Returns true if this class member is static.

Returns:boolean

True if the class member is static.

isSyntheticback to summary
public boolean isSynthetic()

Returns true if this class member is synthetic.

Returns:boolean

True if the class member is synthetic.