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.
- Author:
- David Hovemeyer
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class edu.umd.cs.findbugs.classfile.ClassDescriptor
EMPTY_ARRAY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotation
(AnnotationValue annotationValue) Destructively add an annotation to the object.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.boolean
hasStubs()
boolean
Methods inherited from class edu.umd.cs.findbugs.classfile.analysis.ClassNameAndSuperclassInfo
getAccessFlags, getCalledClassDescriptors, getClassDescriptor, getCodeBaseEntry, getInterfaceDescriptorList, getMajorVersion, getMinorVersion, getSuperclassDescriptor, isAbstract, isAnnotation, isDeprecated, isFinal, isInterface, isPrivate, isProtected, isPublic, isStatic, isSynthetic
Methods inherited from class edu.umd.cs.findbugs.classfile.ClassDescriptor
compareTo, createClassDescriptor, createClassDescriptor, createClassDescriptor, createClassDescriptorFromDottedClassName, createClassDescriptorFromSignature, equals, fromFieldSignature, fromResourceName, getClassName, getDottedClassName, getSignature, getSimpleName, getXClass, hashCode, isAnonymousClass, isArray, isClassResource, matches, throwClassNotFoundException, toDottedClassName, toResourceName, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.umd.cs.findbugs.ba.AccessibleEntity
getAccessFlags, getClassDescriptor, isDeprecated, isFinal, isPrivate, isProtected, isPublic, isStatic, isSynthetic
Methods inherited from interface edu.umd.cs.findbugs.classfile.analysis.AnnotatedObject
getClassDescriptor, isSynthetic
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface edu.umd.cs.findbugs.ba.XClass
getCalledClassDescriptors, getInterfaceDescriptorList, getSuperclassDescriptor, isAbstract, isInterface
-
Method Details
-
getXFields
- Specified by:
getXFields
in interfaceXClass
-
getXMethods
- Specified by:
getXMethods
in interfaceXClass
-
getXMethodsInCallOrder
-
findMethod
Description copied from interface:XClass
Find an XMethod matching given parameters.- Specified by:
findMethod
in 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:XClass
Find XMethod matching given MethodDescriptor.- Specified by:
findMethod
in interfaceXClass
- Parameters:
descriptor
- a MethodDescriptor- Returns:
- matching XMethod, or null if there is no matching method
-
findMatchingMethod
Description copied from interface:XClass
Find XMethod matching the name and signature of the supplied method MethodDescriptor. The class descriptor of the argument is ignored.- Specified by:
findMatchingMethod
in interfaceXClass
- Parameters:
descriptor
- a MethodDescriptor- Returns:
- matching XMethod, or null if there is no matching method
-
findField
Description copied from interface:XClass
Find an XField matching given parameters. -
getImmediateEnclosingClass
Description copied from interface:XClass
Get the ClassDescriptor of the immediate enclosing class, or null if this XClass is not a nested or inner class.- Specified by:
getImmediateEnclosingClass
in 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:ClassDescriptor
Get the name of the package in dotted format.- Overrides:
getPackageName
in classClassDescriptor
- Returns:
- the name of the package in dotted format
-
getSlashedPackageName
-
getAnnotationDescriptors
- Specified by:
getAnnotationDescriptors
in interfaceAnnotatedObject
- Specified by:
getAnnotationDescriptors
in interfaceXClass
-
getAnnotations
- Specified by:
getAnnotations
in interfaceAnnotatedObject
-
getAnnotation
- Specified by:
getAnnotation
in interfaceAnnotatedObject
- Specified by:
getAnnotation
in 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:
getElementType
in interfaceAnnotatedObject
-
getSource
-
getContainingScope
- Specified by:
getContainingScope
in interfaceAnnotatedObject
-
getContainingScope0
-
getSourceSignature
- Specified by:
getSourceSignature
in interfaceXClass
-
usesConcurrency
public boolean usesConcurrency()- Specified by:
usesConcurrency
in interfaceXClass
-
hasStubs
public boolean hasStubs()
-