hudson.plugins.warnings.util.model
Class AbstractAnnotation

java.lang.Object
  extended by hudson.plugins.warnings.util.model.AbstractAnnotation
All Implemented Interfaces:
FileAnnotation, java.io.Serializable
Direct Known Subclasses:
Warning

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

A base class for annotations.

Author:
Ulli Hafner
See Also:
Serialized Form

Constructor Summary
AbstractAnnotation(Priority priority, java.lang.String message, int start, int end, java.lang.String category, java.lang.String type)
          Creates a new instance of AbstractAnnotation.
 
Method Summary
 void addLineRange(LineRange lineRange)
          Adds another line range to this annotation.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getCategory()
          Returns the category of the annotation.
 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.
 java.lang.String getShortFileName()
          Gets the associated file name of this bug (without path).
 java.lang.String getType()
          Returns the annotation type.
 int hashCode()
           
 void setFileName(java.lang.String fileName)
          Sets the file name to the specified value.
 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.warnings.util.model.FileAnnotation
getToolTip
 

Constructor Detail

AbstractAnnotation

public AbstractAnnotation(Priority priority,
                          java.lang.String message,
                          int start,
                          int end,
                          java.lang.String category,
                          java.lang.String type)
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

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

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

getCategory

public java.lang.String getCategory()
Returns the category of the annotation. Might be an empty string if there is no category.

Specified by:
getCategory in interface FileAnnotation
Returns:
the annotation category

getType

public java.lang.String getType()
Returns the annotation type. Might be an empty string if there is no type.

Specified by:
getType in interface FileAnnotation
Returns:
the annotation type

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

getShortFileName

public java.lang.String getShortFileName()
Gets the associated file name of this bug (without path).

Returns:
the short file name


Copyright © 2008. All Rights Reserved.