Package edu.umd.cs.findbugs
Class ClassAnnotation
java.lang.Object
edu.umd.cs.findbugs.BugAnnotationWithSourceLines
edu.umd.cs.findbugs.PackageMemberAnnotation
edu.umd.cs.findbugs.ClassAnnotation
- All Implemented Interfaces:
BugAnnotation
,XMLWriteable
,XMLWriteableWithMessages
,Serializable
,Cloneable
,Comparable<BugAnnotation>
A BugAnnotation object specifying a Java class involved in the bug.
- Author:
- David Hovemeyer
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class edu.umd.cs.findbugs.PackageMemberAnnotation
className, description
Fields inherited from class edu.umd.cs.findbugs.BugAnnotationWithSourceLines
sourceFileName, sourceLines
Fields inherited from interface edu.umd.cs.findbugs.BugAnnotation
MESSAGE_TAG
-
Constructor Summary
ConstructorDescriptionClassAnnotation
(String className) Constructor.ClassAnnotation
(String className, String sourceFileName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(BugAnnotationVisitor visitor) Accept a BugAnnotationVisitor.int
boolean
contains
(ClassAnnotation other) boolean
protected String
formatPackageMember
(String key, ClassAnnotation primaryClass) Do default and subclass-specific formatting.static ClassAnnotation
fromClassDescriptor
(ClassDescriptor classDescriptor) Factory method to create a ClassAnnotation from a ClassDescriptor.Get the SourceLineAnnotation describing the source lines where the method is defined.static SourceLineAnnotation
getSourceLinesForClass
(String className, String sourceFileName) int
hashCode()
boolean
Is this annotation used to compute instance hashes or match bug instances across versionsvoid
Write this object to given XMLOutput.void
Methods inherited from class edu.umd.cs.findbugs.PackageMemberAnnotation
format, getClassDescriptor, getClassName, getDescription, getJavaAnnotationNames, getPackageName, getSimpleClassName, getSlashedClassName, removePackage, removePackageName, setDescription, setJavaAnnotationNames, shorten, toString, toString
Methods inherited from class edu.umd.cs.findbugs.BugAnnotationWithSourceLines
clone, getSourceFileName, setSourceLines
-
Field Details
-
SUBCLASS_ROLE
- See Also:
-
SUPERCLASS_ROLE
- See Also:
-
ANONYMOUS_ROLE
- See Also:
-
RECOMMENDED_SUPERCLASS_ROLE
- See Also:
-
IMPLEMENTED_INTERFACE_ROLE
- See Also:
-
INTERFACE_ROLE
- See Also:
-
ANNOTATION_ROLE
- See Also:
-
TYPE_QUALIFIER_ROLE
- See Also:
-
-
Constructor Details
-
ClassAnnotation
Constructor.- Parameters:
className
- the name of the class
-
ClassAnnotation
-
-
Method Details
-
isSignificant
public boolean isSignificant()Description copied from interface:BugAnnotation
Is this annotation used to compute instance hashes or match bug instances across versions- Specified by:
isSignificant
in interfaceBugAnnotation
- Overrides:
isSignificant
in classPackageMemberAnnotation
- Returns:
- true if significant
-
fromClassDescriptor
Factory method to create a ClassAnnotation from a ClassDescriptor.- Parameters:
classDescriptor
- the ClassDescriptor- Returns:
- the ClassAnnotation
-
accept
Description copied from interface:BugAnnotation
Accept a BugAnnotationVisitor.- Parameters:
visitor
- the visitor to accept
-
formatPackageMember
Description copied from class:PackageMemberAnnotation
Do default and subclass-specific formatting.- Specified by:
formatPackageMember
in classPackageMemberAnnotation
- Parameters:
key
- the key specifying how to do the formattingprimaryClass
- TODO
-
hashCode
public int hashCode() -
equals
-
contains
-
getTopLevelClass
-
compareTo
-
getSourceLines
Description copied from class:BugAnnotationWithSourceLines
Get the SourceLineAnnotation describing the source lines where the method is defined.- Overrides:
getSourceLines
in classBugAnnotationWithSourceLines
- Returns:
- the SourceLineAnnotation, or null if there is no source information for this package element
-
getSourceLinesForClass
public static SourceLineAnnotation getSourceLinesForClass(@DottedClassName String className, String sourceFileName) -
writeXML
Description copied from interface:XMLWriteable
Write this object to given XMLOutput.- Parameters:
xmlOutput
- the XMLOutput for the document- Throws:
IOException
-
writeXML
public void writeXML(XMLOutput xmlOutput, boolean addMessages, boolean isPrimary) throws IOException - Throws:
IOException
-