hudson.plugins.pmd.parser
Class Bug

java.lang.Object
  extended by hudson.plugins.pmd.util.model.AbstractAnnotation
      extended by hudson.plugins.pmd.parser.Bug
All Implemented Interfaces:
FileAnnotation, java.io.Serializable

public class Bug
extends AbstractAnnotation

A serializable Java Bean class representing a warning.

Note: this class has a natural ordering that is inconsistent with equals.

See Also:
Serialized Form

Constructor Summary
Bug(Priority priority, java.lang.String message, java.lang.String category, java.lang.String type)
          Creates a new instance of Bug that has no associated line in code (file warning).
Bug(Priority priority, java.lang.String message, java.lang.String category, java.lang.String type, int lineNumber)
          Creates a new instance of Bug.
Bug(Priority priority, java.lang.String message, java.lang.String category, java.lang.String type, int start, int end)
          Creates a new instance of Bug.
Bug(Priority priority, java.lang.String message, java.lang.String category, java.lang.String type, int start, int end, java.lang.String tooltip)
          Creates a new instance of Bug.
 
Method Summary
 boolean equals(java.lang.Object obj)
          
 java.lang.String getCategory()
          Returns the category of the bug.
 java.lang.String getShortFileName()
          Gets the associated file name of this bug (without path).
 java.lang.String getToolTip()
          Returns the a detailed description that will be used as tooltip.
 java.lang.String getType()
          Returns the bug type.
 int hashCode()
          
 
Methods inherited from class hudson.plugins.pmd.util.model.AbstractAnnotation
addLineRange, getFileName, getKey, getLineRanges, getMessage, getModuleName, getPackageName, getPrimaryLineNumber, getPriority, setFileName, setModuleName, setPackageName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bug

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

Parameters:
priority - the priority
message - the message of the warning
category - the warning category
type - the identifier of the warning type
start - the first line of the line range
end - the last line of the line range

Bug

public Bug(Priority priority,
           java.lang.String message,
           java.lang.String category,
           java.lang.String type,
           int lineNumber)
Creates a new instance of Bug.

Parameters:
priority - the priority
message - the message of the warning
category - the warning category
type - the identifier of the warning type
lineNumber - the line number of the warning in the corresponding file

Bug

public Bug(Priority priority,
           java.lang.String message,
           java.lang.String category,
           java.lang.String type)
Creates a new instance of Bug that has no associated line in code (file warning).

Parameters:
priority - the priority
message - the message of the warning
category - the warning category
type - the identifier of the warning type

Bug

public Bug(Priority priority,
           java.lang.String message,
           java.lang.String category,
           java.lang.String type,
           int start,
           int end,
           java.lang.String tooltip)
Creates a new instance of Bug.

Parameters:
priority - the priority
message - the message of the warning
category - the warning category
type - the identifier of the warning type
start - the first line of the line range
end - the last line of the line range
tooltip - the tooltip to show
Method Detail

getCategory

public java.lang.String getCategory()
Returns the category of the bug.

Returns:
the bug category

getShortFileName

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

Returns:
the short file name

getType

public java.lang.String getType()
Returns the bug type.

Returns:
the bug type

getToolTip

public java.lang.String getToolTip()
Returns the a detailed description that will be used as tooltip.

Returns:
the tooltip of this annotation

hashCode

public int hashCode()

Overrides:
hashCode in class AbstractAnnotation

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class AbstractAnnotation


Copyright © 2008. All Rights Reserved.