hudson.plugins.tasks
Class TasksResult

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

public class TasksResult
extends BuildResult

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

Field Summary
 
Fields inherited from class hudson.plugins.tasks.util.BuildResult
XSTREAM
 
Constructor Summary
TasksResult(hudson.model.AbstractBuild<?,?> build, TasksParserResult 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, TasksParserResult project, java.lang.String high, java.lang.String normal, java.lang.String low)
          Creates a new instance of TasksResult.
 
Method Summary
 void doStatistics(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
          Generates a PNG image for high/normal/low distribution of the specified object.
 java.util.Collection<java.lang.String> getAvailablePriorities()
          Returns the defined priorities.
 AnnotationContainer getContainer()
          Gets the annotation container.
 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()
          Returns the files of the project.
 java.lang.String getLocalizedPriority(java.lang.String priorityName)
          Returns a localized priority name.
 MavenModule getModule(java.lang.String name)
          Returns the module with the specified 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 getNumberOfFiles()
          Returns the number of scanned files in this project.
 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.
 JavaProject getProject()
          Returns the associated project of this result.
protected  java.lang.String getSerializationFileName()
          Returns the name of the file to store the serialized annotations.
 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.
 
Methods inherited from class hudson.plugins.tasks.util.BuildResult
getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getDataFile, getNumberOfAnnotations, getOwner, hasAnnotations, hasAnnotations, hasAnnotations, hasNoAnnotations, hasNoAnnotations, hasNoAnnotations, isCurrent
 
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,
                   TasksParserResult 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 annotations
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,
                   TasksParserResult 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

getNumberOfFiles

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

Returns:
the number of scanned files in this project

getNumberOfAnnotations

public int getNumberOfAnnotations()
Gets the number of tasks.

Returns:
the number of tasks

getNumberOfAnnotations

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

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.

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 JavaProject getProject()
Returns the associated project of this result.

Returns:
the associated project of this result.

getSerializationFileName

protected java.lang.String getSerializationFileName()
Returns the name of the file to store the serialized annotations.

Specified by:
getSerializationFileName in class BuildResult
Returns:
the name of the file to store the serialized annotations

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).

getContainer

public AnnotationContainer getContainer()
Gets the annotation container.

Specified by:
getContainer in class BuildResult
Returns:
the container

getModule

public MavenModule getModule(java.lang.String name)
Returns the module with the specified name.

Parameters:
name - the module to get
Returns:
the module

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

doStatistics

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

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

getFiles

public java.util.Collection<WorkspaceFile> getFiles()
Returns the files of the project.

Returns:
the files of the project


Copyright © 2008. All Rights Reserved.