hudson.plugins.violations.hudson
Class AbstractViolationsBuildAction<T extends AbstractViolationsBuildAction>

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Actionable
          extended by hudson.plugins.violations.hudson.AbstractViolationsBuildAction<T>
All Implemented Interfaces:
hudson.model.Action, hudson.model.HealthReportingAction, hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem, org.kohsuke.stapler.StaplerProxy
Direct Known Subclasses:
ViolationsBuildAction, ViolationsMavenAggregatedBuildAction

public abstract class AbstractViolationsBuildAction<T extends AbstractViolationsBuildAction>
extends hudson.model.Actionable
implements hudson.model.Action, hudson.model.HealthReportingAction, org.kohsuke.stapler.StaplerProxy

Common base class for recording violations results.


Field Summary
protected  hudson.model.AbstractBuild<?,?> owner
           
 
Constructor Summary
protected AbstractViolationsBuildAction(hudson.model.AbstractBuild<?,?> owner)
          Constructor setting the owner build.
 
Method Summary
protected  org.jfree.chart.JFreeChart createChart(org.jfree.data.category.CategoryDataset dataset)
           
 void doGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          This corresponds to the url ./graph.
 ViolationsReport findReport()
          Gets the first valid violations report.
 hudson.model.AbstractBuild<?,?> getBuild()
          Get the build that owns this action.
 hudson.model.HealthReport getBuildHealth()
          Get the build report.
 java.lang.String getDisplayName()
          The display name for the url to be displayed on the build page right hand side.
 java.lang.String getIconFileName()
          Get the icon to display.
 T getPreviousResult()
          Gets the test result of the previous build, if it's recorded, or null.
abstract  ViolationsReport getReport()
          Get the report.
 java.lang.String getSearchUrl()
          Get the search url.
 java.lang.Object getTarget()
          The object to use then the URL is pressed This handles the url's from "${buildpage}/violations/" except for any overridden by do methods in this class (in this instance doGraph).
 java.lang.String getUrlName()
          The url to get to the "target" object.
 
Methods inherited from class hudson.model.Actionable
addAction, getAction, getAction, getActions, getActions, getDynamic
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

owner

protected final hudson.model.AbstractBuild<?,?> owner
Constructor Detail

AbstractViolationsBuildAction

protected AbstractViolationsBuildAction(hudson.model.AbstractBuild<?,?> owner)
Constructor setting the owner build.

Method Detail

getReport

public abstract ViolationsReport getReport()
Get the report.

Returns:
the report.

getTarget

public java.lang.Object getTarget()
The object to use then the URL is pressed This handles the url's from "${buildpage}/violations/" except for any overridden by do methods in this class (in this instance doGraph).

Specified by:
getTarget in interface org.kohsuke.stapler.StaplerProxy
Returns:
the violations report.

getBuild

public hudson.model.AbstractBuild<?,?> getBuild()
Get the build that owns this action.

Returns:
the build.

getBuildHealth

public hudson.model.HealthReport getBuildHealth()
Get the build report.

Specified by:
getBuildHealth in interface hudson.model.HealthReportingAction
Returns:
the build report (null if not available).

getDisplayName

public java.lang.String getDisplayName()
The display name for the url to be displayed on the build page right hand side.

Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject
Returns:
the display name.

getUrlName

public java.lang.String getUrlName()
The url to get to the "target" object.

Specified by:
getUrlName in interface hudson.model.Action
Returns:
the url

getSearchUrl

public java.lang.String getSearchUrl()
Get the search url.

Specified by:
getSearchUrl in interface hudson.search.SearchItem
Returns:
the url.

getIconFileName

public java.lang.String getIconFileName()
Get the icon to display. FIXME: MAY NEED TO SPECIFY ROOT DIR.

Specified by:
getIconFileName in interface hudson.model.Action
Returns:
the violations 24x24 icon.

findReport

public ViolationsReport findReport()
Gets the first valid violations report.

Returns:
the first violations report found for this build.

getPreviousResult

public T getPreviousResult()
Gets the test result of the previous build, if it's recorded, or null.


doGraph

public void doGraph(org.kohsuke.stapler.StaplerRequest req,
                    org.kohsuke.stapler.StaplerResponse rsp)
             throws java.io.IOException
This corresponds to the url ./graph.

Parameters:
req - the request parameters.
rsp - the response.
Throws:
java.io.IOException - if there is an error writing the graph

createChart

protected org.jfree.chart.JFreeChart createChart(org.jfree.data.category.CategoryDataset dataset)


Copyright © 2004-2012. All Rights Reserved.