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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class edu.umd.cs.findbugs.PackageMemberAnnotation
className, descriptionFields inherited from class edu.umd.cs.findbugs.BugAnnotationWithSourceLines
sourceFileName, sourceLinesFields inherited from interface edu.umd.cs.findbugs.BugAnnotation
MESSAGE_TAG -
Constructor Summary
ConstructorsConstructorDescriptionClassAnnotation(String className) Constructor.ClassAnnotation(String className, String sourceFileName) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(BugAnnotationVisitor visitor) Accept a BugAnnotationVisitor.intbooleancontains(ClassAnnotation other) booleanprotected StringformatPackageMember(String key, ClassAnnotation primaryClass) Do default and subclass-specific formatting.static ClassAnnotationfromClassDescriptor(ClassDescriptor classDescriptor) Factory method to create a ClassAnnotation from a ClassDescriptor.Get the SourceLineAnnotation describing the source lines where the method is defined.static SourceLineAnnotationgetSourceLinesForClass(String className, String sourceFileName) inthashCode()booleanIs this annotation used to compute instance hashes or match bug instances across versionsvoidWrite this object to given XMLOutput.voidMethods inherited from class edu.umd.cs.findbugs.PackageMemberAnnotation
format, getClassDescriptor, getClassName, getDescription, getPackageName, getSimpleClassName, getSlashedClassName, removePackage, removePackageName, setDescription, shorten, toString, toStringMethods 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:BugAnnotationIs this annotation used to compute instance hashes or match bug instances across versions- Specified by:
isSignificantin interfaceBugAnnotation- Overrides:
isSignificantin 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:BugAnnotationAccept a BugAnnotationVisitor.- Parameters:
visitor- the visitor to accept
-
formatPackageMember
Description copied from class:PackageMemberAnnotationDo default and subclass-specific formatting.- Specified by:
formatPackageMemberin 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:BugAnnotationWithSourceLinesGet the SourceLineAnnotation describing the source lines where the method is defined.- Overrides:
getSourceLinesin 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:XMLWriteableWrite 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
-