Class Tool
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<Tool>
-
- io.jenkins.plugins.analysis.core.model.Tool
-
- All Implemented Interfaces:
Describable<Tool>
,Serializable
- Direct Known Subclasses:
AxivionSuite
,OpenTasks
,ReportScanningTool
public abstract class Tool extends AbstractDescribableImpl<Tool> implements Serializable
A tool that can produce areport of issues
in some way. If your tool produces issues by scanning a compiler log or static analysis report file, consider deriving fromAnalysisModelParser
.- Author:
- Ullrich Hafner
- See Also:
AnalysisModelParser
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Tool.ToolDescriptor
Descriptor forTool
.
-
Constructor Summary
Constructors Constructor Description Tool()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getActualId()
Returns the actual ID of the tool.String
getActualName()
Returns the actual name of the tool.Tool.ToolDescriptor
getDescriptor()
String
getId()
StaticAnalysisLabelProvider
getLabelProvider()
Returns the associated label provider for this tool.String
getName()
String
getSymbolName()
Returns theSymbol
name of this tool.abstract edu.hm.hafner.analysis.Report
scan(Run<?,?> run, FilePath workspace, Charset sourceCodeEncoding, LogHandler logger)
Scans the results of a build for issues.void
setId(String id)
Overrides the default ID of the results.void
setName(String name)
Overrides the name of the results.
-
-
-
Method Detail
-
setId
@DataBoundSetter public void setId(String id)
Overrides the default ID of the results. The ID is used as URL of the results and as identifier in UI elements. If no ID is given, then the default ID is used, see correspondingTool.ToolDescriptor
.- Parameters:
id
- the ID of the results- See Also:
Tool.ToolDescriptor.getId()
-
getId
public String getId()
-
getActualId
public String getActualId()
Returns the actual ID of the tool. If no user defined ID is given, then the default ID is returned.- Returns:
- the ID
- See Also:
setId(String)
,Tool.ToolDescriptor.getId()
-
setName
@DataBoundSetter public void setName(String name)
Overrides the name of the results. The name is used for all labels in the UI. If no name is given, then the default name is used, see correspondingTool.ToolDescriptor
.- Parameters:
name
- the name of the results- See Also:
Tool.ToolDescriptor.getName()
-
getName
public String getName()
-
getActualName
public String getActualName()
Returns the actual name of the tool. If no user defined name is given, then the default name is returned.- Returns:
- the name
- See Also:
setName(String)
,Tool.ToolDescriptor.getName()
-
getSymbolName
public String getSymbolName()
Returns theSymbol
name of this tool.- Returns:
- the name of this tool, or "undefined" if no symbol has been defined
-
getLabelProvider
public StaticAnalysisLabelProvider getLabelProvider()
Returns the associated label provider for this tool.- Returns:
- the label provider
-
getDescriptor
public Tool.ToolDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<Tool>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<Tool>
-
scan
public abstract edu.hm.hafner.analysis.Report scan(Run<?,?> run, FilePath workspace, Charset sourceCodeEncoding, LogHandler logger) throws edu.hm.hafner.analysis.ParsingException, edu.hm.hafner.analysis.ParsingCanceledException
Scans the results of a build for issues. This method is invoked on Jenkins master. I.e., if a tool wants to process some build results it is required to run aMasterToSlaveCallable
.- Parameters:
run
- the buildworkspace
- the workspace of the buildsourceCodeEncoding
- the encoding to use to read source fileslogger
- the logger- Returns:
- the created report
- Throws:
edu.hm.hafner.analysis.ParsingException
- Signals that during parsing a non recoverable error has been occurrededu.hm.hafner.analysis.ParsingCanceledException
- Signals that the parsing has been aborted by the user
-
-