Class ClassInfo
java.lang.Object
edu.umd.cs.findbugs.classfile.ClassDescriptor
edu.umd.cs.findbugs.classfile.analysis.ClassNameAndSuperclassInfo
edu.umd.cs.findbugs.classfile.analysis.ClassInfo
- All Implemented Interfaces:
AccessibleEntity, XClass, AnnotatedObject, Serializable, Comparable<ClassDescriptor>
ClassInfo represents important metadata about a loaded class, such as its
superclass, access flags, codebase entry, etc.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) Map<ClassDescriptor, AnnotationValue> private final String(package private) AnnotatedObjectprivate booleanprivate static final booleanprivate final booleanprivate final ClassDescriptorprivate final MethodInfo[]private final Map<String, Map<String, MethodInfo>> The class' polymorphic methods, indexed by name and signature.private final Stringprivate final booleanprivate final FieldInfo[]private final MethodInfo[]Fields inherited from class ClassDescriptor
EMPTY_ARRAY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateClassInfo(ClassDescriptor classDescriptor, String classSourceSignature, ClassDescriptor superclassDescriptor, ClassDescriptor[] interfaceDescriptorList, ICodeBaseEntry codeBaseEntry, int accessFlags, String source, int majorVersion, int minorVersion, Collection<ClassDescriptor> referencedClassDescriptorList, Set<ClassDescriptor> calledClassDescriptors, Map<ClassDescriptor, AnnotationValue> classAnnotations, FieldInfo[] fieldDescriptorList, MethodInfo[] methodInfoList, ClassDescriptor immediateEnclosingClass, boolean usesConcurrency, boolean hasStubs, Map<String, Map<String, MethodInfo>> polymorphicMethods) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAnnotation(AnnotationValue annotationValue) Destructively add an annotation to the object.private MethodInfo[]Find an XField matching given parameters.findMatchingMethod(MethodDescriptor descriptor) Find XMethod matching the name and signature of the supplied method MethodDescriptor.findMethod(MethodDescriptor descriptor) Find XMethod matching given MethodDescriptor.findMethod(String methodName, String methodSig, boolean isStatic) Find an XMethod matching given parameters.getAnnotation(ClassDescriptor desc) Get the ClassDescriptor of the immediate enclosing class, or null if this XClass is not a nested or inner class.Get the name of the package in dotted format.booleanhasStubs()booleanMethods inherited from class ClassNameAndSuperclassInfo
getAccessFlags, getCalledClassDescriptors, getClassDescriptor, getCodeBaseEntry, getInterfaceDescriptorList, getMajorVersion, getMinorVersion, getSuperclassDescriptor, isAbstract, isAnnotation, isDeprecated, isFinal, isInterface, isPrivate, isProtected, isPublic, isStatic, isSyntheticMethods inherited from class ClassDescriptor
compareTo, createClassDescriptor, createClassDescriptor, createClassDescriptor, createClassDescriptorFromDottedClassName, createClassDescriptorFromSignature, equals, fromFieldSignature, fromResourceName, getClassName, getDottedClassName, getSignature, getSimpleName, getXClass, hashCode, isAnonymousClass, isArray, isClassResource, matches, throwClassNotFoundException, toDottedClassName, toResourceName, toStringMethods inherited from interface AccessibleEntity
getAccessFlags, getClassDescriptor, isDeprecated, isFinal, isPrivate, isProtected, isPublic, isStatic, isSyntheticMethods inherited from interface AnnotatedObject
getClassDescriptor, isSyntheticMethods inherited from interface Comparable
compareToMethods inherited from interface XClass
getCalledClassDescriptors, getInterfaceDescriptorList, getSuperclassDescriptor, isAbstract, isInterface
-
Field Details
-
DEBUG
private static final boolean DEBUG -
xFields
-
xMethods
-
methodsInCallOrder
-
immediateEnclosingClass
-
classAnnotations
Map<ClassDescriptor, AnnotationValue> classAnnotations -
classSourceSignature
-
source
-
usesConcurrency
private final boolean usesConcurrency -
hasStubs
private final boolean hasStubs -
containingScope
-
containingScopeCached
private boolean containingScopeCached -
polymorphicMethods
The class' polymorphic methods, indexed by name and signature. SeeMethodHandlewhich is a special case where a method has multiple signatures. The methods are assumed to be non-static.
-
-
Constructor Details
-
ClassInfo
private ClassInfo(ClassDescriptor classDescriptor, String classSourceSignature, ClassDescriptor superclassDescriptor, ClassDescriptor[] interfaceDescriptorList, ICodeBaseEntry codeBaseEntry, int accessFlags, String source, int majorVersion, int minorVersion, Collection<ClassDescriptor> referencedClassDescriptorList, Set<ClassDescriptor> calledClassDescriptors, Map<ClassDescriptor, AnnotationValue> classAnnotations, FieldInfo[] fieldDescriptorList, MethodInfo[] methodInfoList, ClassDescriptor immediateEnclosingClass, boolean usesConcurrency, boolean hasStubs, Map<String, Map<String, MethodInfo>> polymorphicMethods) - Parameters:
classDescriptor- ClassDescriptor representing the class namesuperclassDescriptor- ClassDescriptor representing the superclass nameinterfaceDescriptorList- ClassDescriptors representing implemented interface namescodeBaseEntry- codebase entry class was loaded fromaccessFlags- class's access flagsreferencedClassDescriptorList- ClassDescriptors of all classes/interfaces referenced by the classfieldDescriptorList- FieldDescriptors of fields defined in the classmethodInfoList- MethodDescriptors of methods defined in the class
-
-
Method Details
-
computeMethodsInCallOrder
-
getXFields
- Specified by:
getXFieldsin interfaceXClass
-
getXMethods
- Specified by:
getXMethodsin interfaceXClass
-
getXMethodsInCallOrder
-
findMethod
Description copied from interface:XClassFind an XMethod matching given parameters.- Specified by:
findMethodin interfaceXClass- Parameters:
methodName- name of the methodmethodSig- signature of the methodisStatic- true if the method is static, false if not- Returns:
- matching XMethod, or null if there is no matching XMethod
-
findMethod
Description copied from interface:XClassFind XMethod matching given MethodDescriptor.- Specified by:
findMethodin interfaceXClass- Parameters:
descriptor- a MethodDescriptor- Returns:
- matching XMethod, or null if there is no matching method
-
findMatchingMethod
Description copied from interface:XClassFind XMethod matching the name and signature of the supplied method MethodDescriptor. The class descriptor of the argument is ignored.- Specified by:
findMatchingMethodin interfaceXClass- Parameters:
descriptor- a MethodDescriptor- Returns:
- matching XMethod, or null if there is no matching method
-
findField
Description copied from interface:XClassFind an XField matching given parameters. -
getImmediateEnclosingClass
Description copied from interface:XClassGet the ClassDescriptor of the immediate enclosing class, or null if this XClass is not a nested or inner class.- Specified by:
getImmediateEnclosingClassin interfaceXClass- Returns:
- the ClassDescriptor of the immediate enclosing class, or null if this XClass is not a nested or inner class
-
getPackageName
Description copied from class:ClassDescriptorGet the name of the package in dotted format.- Overrides:
getPackageNamein classClassDescriptor- Returns:
- the name of the package in dotted format
-
getSlashedPackageName
-
getAnnotationDescriptors
- Specified by:
getAnnotationDescriptorsin interfaceAnnotatedObject- Specified by:
getAnnotationDescriptorsin interfaceXClass
-
getAnnotations
- Specified by:
getAnnotationsin interfaceAnnotatedObject
-
getAnnotation
- Specified by:
getAnnotationin interfaceAnnotatedObject- Specified by:
getAnnotationin interfaceXClass
-
addAnnotation
Destructively add an annotation to the object. In general, this is not a great idea, since it could cause the same class to appear to have different annotations at different times. However, this method is necessary for "built-in" annotations that FindBugs adds to system classes. As long as we add such annotations early enough that nobody will notice, we should be ok.- Parameters:
annotationValue- an AnnotationValue to add to the class
-
getElementType
- Specified by:
getElementTypein interfaceAnnotatedObject
-
getSource
-
getContainingScope
- Specified by:
getContainingScopein interfaceAnnotatedObject
-
getContainingScope0
-
getSourceSignature
- Specified by:
getSourceSignaturein interfaceXClass
-
usesConcurrency
public boolean usesConcurrency()- Specified by:
usesConcurrencyin interfaceXClass
-
hasStubs
-