hudson.plugins.tasks
Class TasksResult

java.lang.Object
  extended by hudson.plugins.tasks.TasksResult
All Implemented Interfaces:
hudson.model.ModelObject, AnnotationProvider, java.io.Serializable

public class TasksResult
extends java.lang.Object
implements hudson.model.ModelObject, java.io.Serializable, AnnotationProvider

Represents the results of the task scanner. One instance of this class is persisted for each build via an XML file.

Author:
Ulli Hafner
See Also:
Serialized Form

Constructor Summary
TasksResult(hudson.model.AbstractBuild<?,?> build, TasksProject project, int previousNumberOfTasks, java.lang.String high, java.lang.String normal, java.lang.String low)
          Creates a new instance of TasksResult.
TasksResult(hudson.model.AbstractBuild<?,?> build, TasksProject project, java.lang.String high, java.lang.String normal, java.lang.String low)
          Creates a new instance of TasksResult.
 
Method Summary
 void doModuleStatistics(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Generates a PNG image for high/normal/low distribution of a maven module.
 void doPackageStatistics(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Generates a PNG image for high/normal/low distribution of a java package.
 FileAnnotation getAnnotation(long key)
          Returns the annotation with the specified key.
 FileAnnotation getAnnotation(java.lang.String key)
          Returns the annotation with the specified key.
 java.util.Collection<FileAnnotation> getAnnotations()
          Returns the annotations for this object.
 java.util.Collection<FileAnnotation> getAnnotations(Priority priority)
          Returns the annotations of the specified priority for this object.
 java.util.Collection<FileAnnotation> getAnnotations(java.lang.String priority)
          Returns the annotations of the specified priority for this object.
 java.util.Collection<java.lang.String> getAvailablePriorities()
          Returns the defined priorities.
 int getDelta()
          Returns the delta between this build and the previous build.
 java.lang.String getDisplayName()
          Returns the display name (bread crumb name) of this result.
 java.lang.Object getDynamic(java.lang.String link, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Returns the dynamic result of this tasks detail view.
 java.util.Collection<WorkspaceFile> getFiles()
           
 java.lang.String getLocalizedPriority(java.lang.String priorityName)
          Returns a localized priority name.
 int getNumberOfAnnotations()
          Gets the number of tasks.
 int getNumberOfAnnotations(Priority priority)
          Returns the total number of tasks of the specified priority for this object.
 int getNumberOfAnnotations(java.lang.String priority)
          Returns the annotations of the specified priority for this object.
 int getNumberOfFiles()
          Returns the number of scanned files in this project.
 hudson.model.AbstractBuild<?,?> getOwner()
          Returns the build as owner of this action.
 java.lang.String getPackageCategoryName()
          Returns the package category name for the scanned files.
 java.util.Collection<JavaPackage> getPackages()
          Returns the packages in this project.
 java.util.List<java.lang.String> getPriorities()
          Returns the actually used priorities.
 TasksProject getProject()
          Returns the associated project of this result.
 java.lang.String getSummary()
          Returns a summary message for the summary.jelly file.
 java.lang.String getTags(Priority priority)
          Returns the tags for the specified priority.
 java.lang.String getTags(java.lang.String priority)
          Returns the tags for the specified priority.
 java.lang.String getToolTip(java.lang.String name)
          Returns a tooltip showing the distribution of priorities for the selected package.
 boolean hasAnnotations()
          Returns whether this objects has annotations.
 boolean hasAnnotations(Priority priority)
          Returns whether this objects has annotations with the specified priority.
 boolean hasAnnotations(java.lang.String priority)
          Returns whether this objects has annotations with the specified priority.
 boolean isCurrent()
          Returns whether this result belongs to the last build.
 boolean isSingleModuleProject()
          Returns whether we only have a single module.
 boolean isSinglePackageProject()
          Returns whether we only have a single package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TasksResult

public TasksResult(hudson.model.AbstractBuild<?,?> build,
                   TasksProject project,
                   java.lang.String high,
                   java.lang.String normal,
                   java.lang.String low)
Creates a new instance of TasksResult.

Parameters:
build - the current build as owner of this action
project - the parsed FindBugs result
high - tag identifiers indicating high priority
normal - tag identifiers indicating normal priority
low - tag identifiers indicating low priority

TasksResult

public TasksResult(hudson.model.AbstractBuild<?,?> build,
                   TasksProject project,
                   int previousNumberOfTasks,
                   java.lang.String high,
                   java.lang.String normal,
                   java.lang.String low)
Creates a new instance of TasksResult.

Parameters:
build - the current build as owner of this action
project - the parsed FindBugs result
previousNumberOfTasks - the previous number of open tasks
high - tag identifiers indicating high priority
normal - tag identifiers indicating normal priority
low - tag identifiers indicating low priority
Method Detail

getSummary

public java.lang.String getSummary()
Returns a summary message for the summary.jelly file.

Returns:
the summary message

isCurrent

public final boolean isCurrent()
Returns whether this result belongs to the last build.

Returns:
true if this result belongs to the last build

getOwner

public final hudson.model.AbstractBuild<?,?> getOwner()
Returns the build as owner of this action.

Returns:
the owner

getNumberOfFiles

public int getNumberOfFiles()
Returns the number of scanned files in this project.

Returns:
the number of scanned files in a TasksProject

getNumberOfAnnotations

public int getNumberOfAnnotations()
Gets the number of tasks.

Specified by:
getNumberOfAnnotations in interface AnnotationProvider
Returns:
the number of tasks

getNumberOfAnnotations

public int getNumberOfAnnotations(Priority priority)
Returns the total number of tasks of the specified priority for this object.

Specified by:
getNumberOfAnnotations in interface AnnotationProvider
Parameters:
priority - the priority
Returns:
total number of tasks of the specified priority for this object

getDisplayName

public java.lang.String getDisplayName()
Returns the display name (bread crumb name) of this result.

Specified by:
getDisplayName in interface hudson.model.ModelObject
Returns:
the display name of this result.

getDelta

public int getDelta()
Returns the delta between this build and the previous build.

Returns:
the delta between this build and the previous build

getPackages

public java.util.Collection<JavaPackage> getPackages()
Returns the packages in this project.

Returns:
the packages in this project

getProject

public TasksProject getProject()
Returns the associated project of this result.

Returns:
the associated project of this result.

getDynamic

public java.lang.Object getDynamic(java.lang.String link,
                                   org.kohsuke.stapler.StaplerRequest request,
                                   org.kohsuke.stapler.StaplerResponse response)
Returns the dynamic result of this tasks detail view. Depending on the number of modules and packages, one of the following detail objects is returned:

Parameters:
link - the link to the source code
request - Stapler request
response - Stapler response
Returns:
the dynamic result of the FindBugs analysis (detail page for a package).

getToolTip

public java.lang.String getToolTip(java.lang.String name)
Returns a tooltip showing the distribution of priorities for the selected package.

Parameters:
name - the package to show the distribution for
Returns:
a tooltip showing the distribution of priorities

isSingleModuleProject

public boolean isSingleModuleProject()
Returns whether we only have a single module. In this case the module statistics are suppressed and only the package statistics are shown.

Returns:
true for single module projects

isSinglePackageProject

public boolean isSinglePackageProject()
Returns whether we only have a single package. In this case the module and package statistics are suppressed and only the tasks are shown.

Returns:
true for single module projects

getPriorities

public java.util.List<java.lang.String> getPriorities()
Returns the actually used priorities.

Returns:
the actually used priorities.

getAvailablePriorities

public java.util.Collection<java.lang.String> getAvailablePriorities()
Returns the defined priorities.

Returns:
the defined priorities.

getLocalizedPriority

public java.lang.String getLocalizedPriority(java.lang.String priorityName)
Returns a localized priority name.

Parameters:
priorityName - priority as String value
Returns:
localized priority name

getTags

public final java.lang.String getTags(java.lang.String priority)
Returns the tags for the specified priority.

Parameters:
priority - the priority
Returns:
the tags for the specified priority

getTags

public final java.lang.String getTags(Priority priority)
Returns the tags for the specified priority.

Parameters:
priority - the priority
Returns:
the tags for the specified priority

getPackageCategoryName

public java.lang.String getPackageCategoryName()
Returns the package category name for the scanned files. Currently, only java and c# files are supported.

Returns:
the package category name for the scanned files

doModuleStatistics

public final void doModuleStatistics(org.kohsuke.stapler.StaplerRequest request,
                                     org.kohsuke.stapler.StaplerResponse response)
                              throws java.io.IOException
Generates a PNG image for high/normal/low distribution of a maven module.

Parameters:
request - Stapler request
response - Stapler response
Throws:
java.io.IOException - in case of an error

doPackageStatistics

public final void doPackageStatistics(org.kohsuke.stapler.StaplerRequest request,
                                      org.kohsuke.stapler.StaplerResponse response)
                               throws java.io.IOException
Generates a PNG image for high/normal/low distribution of a java package.

Parameters:
request - Stapler request
response - Stapler response
Throws:
java.io.IOException - in case of an error

getFiles

public java.util.Collection<WorkspaceFile> getFiles()

getAnnotation

public FileAnnotation getAnnotation(long key)
Returns the annotation with the specified key.

Specified by:
getAnnotation in interface AnnotationProvider
Parameters:
key - the key of the annotation
Returns:
the annotation with the specified key

getAnnotation

public FileAnnotation getAnnotation(java.lang.String key)
Returns the annotation with the specified key.

Specified by:
getAnnotation in interface AnnotationProvider
Parameters:
key - the key of the annotation as a long value in string representation
Returns:
the annotation with the specified key

getAnnotations

public java.util.Collection<FileAnnotation> getAnnotations(Priority priority)
Returns the annotations of the specified priority for this object.

Specified by:
getAnnotations in interface AnnotationProvider
Parameters:
priority - the priority
Returns:
annotations of the specified priority for this object

getAnnotations

public java.util.Collection<FileAnnotation> getAnnotations(java.lang.String priority)
Returns the annotations of the specified priority for this object.

Specified by:
getAnnotations in interface AnnotationProvider
Parameters:
priority - the priority as a string object
Returns:
annotations of the specified priority for this object

hasAnnotations

public boolean hasAnnotations(Priority priority)
Returns whether this objects has annotations with the specified priority.

Specified by:
hasAnnotations in interface AnnotationProvider
Parameters:
priority - the priority
Returns:
true if this objects has annotations.

hasAnnotations

public boolean hasAnnotations(java.lang.String priority)
Returns whether this objects has annotations with the specified priority.

Specified by:
hasAnnotations in interface AnnotationProvider
Parameters:
priority - the priority as a string object
Returns:
true if this objects has annotations.

hasAnnotations

public final boolean hasAnnotations()
Returns whether this objects has annotations.

Specified by:
hasAnnotations in interface AnnotationProvider
Returns:
true if this objects has annotations.

getAnnotations

public java.util.Collection<FileAnnotation> getAnnotations()
Returns the annotations for this object.

Specified by:
getAnnotations in interface AnnotationProvider
Returns:
annotations for this object

getNumberOfAnnotations

public int getNumberOfAnnotations(java.lang.String priority)
Returns the annotations of the specified priority for this object.

Specified by:
getNumberOfAnnotations in interface AnnotationProvider
Parameters:
priority - the priority as a string object
Returns:
annotations of the specified priority for this object


Copyright © 2008. All Rights Reserved.