Package edu.umd.cs.findbugs
Class TypeAnnotation
java.lang.Object
edu.umd.cs.findbugs.BugAnnotationWithSourceLines
edu.umd.cs.findbugs.TypeAnnotation
- All Implemented Interfaces:
BugAnnotation,XMLWriteable,XMLWriteableWithMessages,Serializable,Cloneable,Comparable<BugAnnotation>
Bug annotation class for java types. This is of lighter weight than
ClassAnnotation, and can be used for things like array types.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class edu.umd.cs.findbugs.BugAnnotationWithSourceLines
sourceFileName, sourceLinesFields inherited from interface edu.umd.cs.findbugs.BugAnnotation
MESSAGE_TAG -
Constructor Summary
ConstructorsConstructorDescriptionTypeAnnotation(String typeDescriptor) constructor.TypeAnnotation(String typeDescriptor, String roleDescription) TypeAnnotation(org.apache.bcel.generic.Type objectType) TypeAnnotation(org.apache.bcel.generic.Type objectType, String roleDescription) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(BugAnnotationVisitor visitor) Accept a BugAnnotationVisitor.intbooleanformat(String key, ClassAnnotation primaryClass) Format the annotation as a String.Get a description of this bug annotation.Get the type descriptor.inthashCode()booleanIs this annotation used to compute instance hashes or match bug instances across versionsvoidsetDescription(String roleDescription) Set a description of this bug annotation.voidsetTypeParameters(String typeParameters) toString()voidWrite this object to given XMLOutput.voidMethods inherited from class edu.umd.cs.findbugs.BugAnnotationWithSourceLines
clone, getSourceFileName, getSourceLines, setSourceLines, toString
-
Field Details
-
DEFAULT_ROLE
- See Also:
-
EXPECTED_ROLE
- See Also:
-
FOUND_ROLE
- See Also:
-
CLOSEIT_ROLE
- See Also:
-
UNHASHABLE_ROLE
- See Also:
-
-
Constructor Details
-
TypeAnnotation
constructor.For information on type descriptors,
see http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc. html#14152
or http://www.murrayc.com/learning/java/java_classfileformat.shtml# TypeDescriptors- Parameters:
typeDescriptor- a jvm type descriptor, such as "[I"
-
TypeAnnotation
public TypeAnnotation(org.apache.bcel.generic.Type objectType) -
TypeAnnotation
-
TypeAnnotation
-
-
Method Details
-
getTypeDescriptor
Get the type descriptor.- Returns:
- the jvm type descriptor, such as "[I"
-
accept
Description copied from interface:BugAnnotationAccept a BugAnnotationVisitor.- Parameters:
visitor- the visitor to accept
-
format
Description copied from interface:BugAnnotationFormat the annotation as a String. The given key specifies additional information about how the annotation should be formatted. If the key is empty, then the "default" format will be used.- Parameters:
key- how the annotation should be formattedprimaryClass- The primary class for the bug; some bug annotation format msgs are simplified in relation to that class.
-
setDescription
Description copied from interface:BugAnnotationSet a description of this bug annotation. The description is a key for the FindBugsAnnotationDescriptions resource bundle. -
getDescription
Description copied from interface:BugAnnotationGet a description of this bug annotation. The description is a key for the FindBugsAnnotationDescriptions resource bundle. -
setTypeParameters
-
getTypeParameters
-
hashCode
public int hashCode() -
equals
-
compareTo
-
toString
-
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
-
isSignificant
public boolean isSignificant()Description copied from interface:BugAnnotationIs this annotation used to compute instance hashes or match bug instances across versions- Returns:
- true if significant
-