hudson.plugins.findbugs.util.model
Class AbstractAnnotation

java.lang.Object
  extended by hudson.plugins.findbugs.util.model.AbstractAnnotation
All Implemented Interfaces:
FileAnnotation, java.io.Serializable, java.lang.Comparable<AbstractAnnotation>
Direct Known Subclasses:
Bug

public abstract class AbstractAnnotation
extends java.lang.Object
implements FileAnnotation, java.io.Serializable, java.lang.Comparable<AbstractAnnotation>

A base class for annotations.

See Also:
Serialized Form

Constructor Summary
AbstractAnnotation(Priority priority, java.lang.String message, int start, int end)
          Creates a new instance of AbstractAnnotation.
 
Method Summary
 void addLineRange(LineRange lineRange)
          Adds another line range to this annotation.
 int compareTo(AbstractAnnotation otherTask)
          
 boolean equals(java.lang.Object obj)
          
 java.lang.String getFileName()
          Returns the absolute path of the workspace file that contains this annotation.
 long getKey()
          Returns the unique key of this annotation.
 java.util.Collection<LineRange> getLineRanges()
          Returns a collection of line ranges for this annotation.
 java.lang.String getMessage()
          Returns the message of this annotation.
 java.lang.String getModuleName()
          Returns the name of the maven or ant module that contains this annotation.
 java.lang.String getPackageName()
          Returns the name of package (or namespace) that contains this annotation.
 int getPrimaryLineNumber()
          Returns the primary line number of this annotation that defines the anchor of this annotation.
 Priority getPriority()
          Returns the priority of this annotation.
 int hashCode()
          
 void setFileName(java.lang.String fileName)
          Sets the file name to the specified value.
 void setKey(long key)
          Sets the unique key of this task.
 void setModuleName(java.lang.String moduleName)
          Sets the module name to the specified value.
 void setPackageName(java.lang.String packageName)
          Sets the package name to the specified value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.plugins.findbugs.util.model.FileAnnotation
getToolTip
 

Constructor Detail

AbstractAnnotation

public AbstractAnnotation(Priority priority,
                          java.lang.String message,
                          int start,
                          int end)
Creates a new instance of AbstractAnnotation.

Parameters:
priority - the priority
message - the message of the warning
start - the first line of the line range
end - the last line of the line range
Method Detail

compareTo

public int compareTo(AbstractAnnotation otherTask)

Specified by:
compareTo in interface java.lang.Comparable<AbstractAnnotation>

getMessage

public java.lang.String getMessage()
Returns the message of this annotation.

Specified by:
getMessage in interface FileAnnotation
Returns:
the message of this annotation

getPriority

public Priority getPriority()
Returns the priority of this annotation.

Specified by:
getPriority in interface FileAnnotation
Returns:
the priority of this annotation

setKey

public void setKey(long key)
Sets the unique key of this task.

Parameters:
key - the key

getKey

public final long getKey()
Returns the unique key of this annotation.

Specified by:
getKey in interface FileAnnotation
Returns:
the unique key of this annotation.

getFileName

public final java.lang.String getFileName()
Returns the absolute path of the workspace file that contains this annotation.

Specified by:
getFileName in interface FileAnnotation
Returns:
the name of the workspace file that contains this annotation

setFileName

public final void setFileName(java.lang.String fileName)
Sets the file name to the specified value.

Parameters:
fileName - the value to set

getModuleName

public final java.lang.String getModuleName()
Returns the name of the maven or ant module that contains this annotation.

Specified by:
getModuleName in interface FileAnnotation
Returns:
the name of the module that contains this annotation

setModuleName

public final void setModuleName(java.lang.String moduleName)
Sets the module name to the specified value.

Parameters:
moduleName - the value to set

getPackageName

public final java.lang.String getPackageName()
Returns the name of package (or namespace) that contains this annotation.

Specified by:
getPackageName in interface FileAnnotation
Returns:
the name of the package that contains this annotation

setPackageName

public final void setPackageName(java.lang.String packageName)
Sets the package name to the specified value.

Parameters:
packageName - the value to set

getLineRanges

public final java.util.Collection<LineRange> getLineRanges()
Returns a collection of line ranges for this annotation.

Specified by:
getLineRanges in interface FileAnnotation
Returns:
the collection of line ranges for this annotation.

getPrimaryLineNumber

public final int getPrimaryLineNumber()
Returns the primary line number of this annotation that defines the anchor of this annotation.

Specified by:
getPrimaryLineNumber in interface FileAnnotation
Returns:
the primary line number of this annotation

addLineRange

public void addLineRange(LineRange lineRange)
Adds another line range to this annotation.

Parameters:
lineRange - the line range to add

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object


Copyright © 2008. All Rights Reserved.