edu.umd.cs.findbugs
Class ClassAnnotation

java.lang.Object
  extended by edu.umd.cs.findbugs.PackageMemberAnnotation
      extended by edu.umd.cs.findbugs.ClassAnnotation
All Implemented Interfaces:
BugAnnotation, XMLWriteable, XMLWriteableWithMessages, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<BugAnnotation>

public class ClassAnnotation
extends PackageMemberAnnotation

A BugAnnotation object specifying a Java class involved in the bug.

Author:
David Hovemeyer
See Also:
BugAnnotation, BugInstance, Serialized Form

Field Summary
 
Fields inherited from class edu.umd.cs.findbugs.PackageMemberAnnotation
className, description, sourceFileName, sourceLines
 
Fields inherited from interface edu.umd.cs.findbugs.BugAnnotation
MESSAGE_TAG
 
Constructor Summary
ClassAnnotation(java.lang.String className)
          Constructor.
 
Method Summary
 void accept(BugAnnotationVisitor visitor)
          Accept a BugAnnotationVisitor.
 int compareTo(BugAnnotation o)
           
 boolean equals(java.lang.Object o)
           
protected  java.lang.String formatPackageMember(java.lang.String key)
          Do default and subclass-specific formatting.
 SourceLineAnnotation getSourceLines()
          Get the SourceLineAnnotation describing the source lines where the method is defined.
 int hashCode()
           
 void writeXML(XMLOutput xmlOutput)
          Write this object to given XMLOutput.
 void writeXML(XMLOutput xmlOutput, boolean addMessages)
           
 
Methods inherited from class edu.umd.cs.findbugs.PackageMemberAnnotation
clone, format, getClassName, getDescription, getPackageName, getSourceFileName, setDescription, setSourceLines, shorten, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassAnnotation

public ClassAnnotation(java.lang.String className)
Constructor.

Parameters:
className - the name of the class
Method Detail

accept

public void accept(BugAnnotationVisitor visitor)
Description copied from interface: BugAnnotation
Accept a BugAnnotationVisitor.

Parameters:
visitor - the visitor to accept

formatPackageMember

protected java.lang.String formatPackageMember(java.lang.String key)
Description copied from class: PackageMemberAnnotation
Do default and subclass-specific formatting.

Specified by:
formatPackageMember in class PackageMemberAnnotation
Parameters:
key - the key specifying how to do the formatting

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(BugAnnotation o)

getSourceLines

public SourceLineAnnotation getSourceLines()
Description copied from class: PackageMemberAnnotation
Get the SourceLineAnnotation describing the source lines where the method is defined.

Overrides:
getSourceLines in class PackageMemberAnnotation
Returns:
the SourceLineAnnotation, or null if there is no source information for this package element

writeXML

public void writeXML(XMLOutput xmlOutput)
              throws java.io.IOException
Description copied from interface: XMLWriteable
Write this object to given XMLOutput.

Parameters:
xmlOutput - the XMLOutput for the document
Throws:
java.io.IOException

writeXML

public void writeXML(XMLOutput xmlOutput,
                     boolean addMessages)
              throws java.io.IOException
Throws:
java.io.IOException