FindBugs™ 1.3.9

edu.umd.cs.findbugs.classfile.analysis
Class ClassInfo

java.lang.Object
  extended by edu.umd.cs.findbugs.classfile.ClassDescriptor
      extended by edu.umd.cs.findbugs.classfile.analysis.ClassNameAndSuperclassInfo
          extended by edu.umd.cs.findbugs.classfile.analysis.ClassInfo
All Implemented Interfaces:
AccessibleEntity, XClass, AnnotatedObject, java.io.Serializable, java.lang.Comparable<ClassDescriptor>

public class ClassInfo
extends ClassNameAndSuperclassInfo
implements XClass, AnnotatedObject

ClassInfo represents important metadata about a loaded class, such as its superclass, access flags, codebase entry, etc.

Author:
David Hovemeyer
See Also:
Serialized Form

Nested Class Summary
static class ClassInfo.Builder
           
 
Field Summary
 
Fields inherited from class edu.umd.cs.findbugs.classfile.ClassDescriptor
EMPTY_ARRAY
 
Method Summary
 void addAnnotation(AnnotationValue annotationValue)
          Destructively add an annotation to the object.
 XField findField(java.lang.String name, java.lang.String signature, boolean isStatic)
          Find an XField matching given parameters.
 XMethod findMatchingMethod(MethodDescriptor descriptor)
          Find XMethod matching the name and signature of the supplied method MethodDescriptor.
 XMethod findMethod(MethodDescriptor descriptor)
          Find XMethod matching given MethodDescriptor.
 XMethod findMethod(java.lang.String methodName, java.lang.String methodSig, boolean isStatic)
          Find an XMethod matching given parameters.
 AnnotationValue getAnnotation(ClassDescriptor desc)
           
 java.util.Collection<ClassDescriptor> getAnnotationDescriptors()
           
 java.util.Collection<AnnotationValue> getAnnotations()
           
 AnnotatedObject getContainingScope()
           
 AnnotatedObject getContainingScope0()
           
 java.lang.annotation.ElementType getElementType()
           
 ClassDescriptor getImmediateEnclosingClass()
          Get the ClassDescriptor of the immediate enclosing class, or null if this XClass is not a nested or inner class.
 java.lang.String getPackageName()
          Get the name of the package in dotted format.
 java.lang.String getSlashedPackageName()
           
 java.lang.String getSource()
           
 java.lang.String getSourceSignature()
           
 java.util.List<? extends XField> getXFields()
           
 java.util.List<? extends XMethod> getXMethods()
           
 boolean hasStubs()
           
 boolean usesConcurrency()
           
 
Methods inherited from class edu.umd.cs.findbugs.classfile.analysis.ClassNameAndSuperclassInfo
getAccessFlags, getCalledClassDescriptorList, 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, getSimpleName, hashCode, isAnonymousClass, isClassResource, 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.XClass
getInterfaceDescriptorList, getSuperclassDescriptor, isAbstract, isInterface
 
Methods inherited from interface java.lang.Comparable
compareTo
 
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
 

Method Detail

getXFields

public java.util.List<? extends XField> getXFields()
Specified by:
getXFields in interface XClass
Returns:
Returns the fieldDescriptorList.

getXMethods

public java.util.List<? extends XMethod> getXMethods()
Specified by:
getXMethods in interface XClass
Returns:
Returns the methodDescriptorList.

findMethod

public XMethod findMethod(java.lang.String methodName,
                          java.lang.String methodSig,
                          boolean isStatic)
Description copied from interface: XClass
Find an XMethod matching given parameters.

Specified by:
findMethod in interface XClass
Parameters:
methodName - name of the method
methodSig - signature of the method
isStatic - true if the method is static, false if not
Returns:
matching XMethod, or null if there is no matching XMethod

findMethod

public XMethod findMethod(MethodDescriptor descriptor)
Description copied from interface: XClass
Find XMethod matching given MethodDescriptor.

Specified by:
findMethod in interface XClass
Parameters:
descriptor - a MethodDescriptor
Returns:
matching XMethod, or null if there is no matching method

findMatchingMethod

public XMethod findMatchingMethod(MethodDescriptor descriptor)
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 interface XClass
Parameters:
descriptor - a MethodDescriptor
Returns:
matching XMethod, or null if there is no matching method

findField

public XField findField(java.lang.String name,
                        java.lang.String signature,
                        boolean isStatic)
Description copied from interface: XClass
Find an XField matching given parameters.

Specified by:
findField in interface XClass
Parameters:
name - name of the field
signature - signature of the field
isStatic - true if field is static, false if not
Returns:
XField, or null if there is no matching XField

getImmediateEnclosingClass

public ClassDescriptor 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 interface XClass
Returns:
Returns the immediateEnclosingClass.

getPackageName

public java.lang.String getPackageName()
Description copied from class: ClassDescriptor
Get the name of the package in dotted format.

Overrides:
getPackageName in class ClassDescriptor
Returns:
the name of the package in dotted format

getSlashedPackageName

public java.lang.String getSlashedPackageName()

getAnnotationDescriptors

public java.util.Collection<ClassDescriptor> getAnnotationDescriptors()
Specified by:
getAnnotationDescriptors in interface XClass
Specified by:
getAnnotationDescriptors in interface AnnotatedObject

getAnnotations

public java.util.Collection<AnnotationValue> getAnnotations()
Specified by:
getAnnotations in interface AnnotatedObject

getAnnotation

public AnnotationValue getAnnotation(ClassDescriptor desc)
Specified by:
getAnnotation in interface XClass
Specified by:
getAnnotation in interface AnnotatedObject

addAnnotation

public void addAnnotation(AnnotationValue annotationValue)
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

public java.lang.annotation.ElementType getElementType()
Specified by:
getElementType in interface AnnotatedObject

getSource

@CheckForNull
public java.lang.String getSource()
Specified by:
getSource in interface XClass
Returns:
the Source attribute

getContainingScope

@CheckForNull
public AnnotatedObject getContainingScope()
Specified by:
getContainingScope in interface AnnotatedObject

getContainingScope0

@CheckForNull
public AnnotatedObject getContainingScope0()

getSourceSignature

public java.lang.String getSourceSignature()
Specified by:
getSourceSignature in interface XClass

usesConcurrency

public boolean usesConcurrency()
Specified by:
usesConcurrency in interface XClass

hasStubs

public boolean hasStubs()
Specified by:
hasStubs in interface XClass

FindBugs™ 1.3.9

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.