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
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
Fields inherited from class edu.umd.cs.findbugs.BugAnnotationWithSourceLines
sourceFileName, sourceLines
Fields inherited from interface edu.umd.cs.findbugs.BugAnnotation
MESSAGE_TAG
-
Constructor Summary
ConstructorDescriptionTypeAnnotation
(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 TypeMethodDescriptionvoid
accept
(BugAnnotationVisitor visitor) Accept a BugAnnotationVisitor.int
boolean
format
(String key, ClassAnnotation primaryClass) Format the annotation as a String.Get a description of this bug annotation.Get the type descriptor.int
hashCode()
boolean
Is this annotation used to compute instance hashes or match bug instances across versionsvoid
setDescription
(String roleDescription) Set a description of this bug annotation.void
setTypeParameters
(String typeParameters) toString()
void
Write this object to given XMLOutput.void
Methods 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:BugAnnotation
Accept a BugAnnotationVisitor.- Parameters:
visitor
- the visitor to accept
-
format
Description copied from interface:BugAnnotation
Format 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:BugAnnotation
Set a description of this bug annotation. The description is a key for the FindBugsAnnotationDescriptions resource bundle. -
getDescription
Description copied from interface:BugAnnotation
Get 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: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
-
isSignificant
public boolean isSignificant()Description copied from interface:BugAnnotation
Is this annotation used to compute instance hashes or match bug instances across versions- Returns:
- true if significant
-