Class ParserConfiguration
java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
io.jenkins.plugins.util.GlobalConfigurationItem
io.jenkins.plugins.analysis.warnings.groovy.ParserConfiguration
- All Implemented Interfaces:
ExtensionPoint,Describable<GlobalConfiguration>,Saveable,Loadable,OnMaster
@Extension
@Symbol("warningsParsers")
public class ParserConfiguration
extends io.jenkins.plugins.util.GlobalConfigurationItem
Global configuration of Groovy based parsers. These parsers are dynamically registered.
- Author:
- Ullrich Hafner
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRegisters all Groovy parsers as static analysis tools in theLabelProviderFactoryso that these parsers can be referenced in actions.Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.SelfNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz -
Constructor Summary
ConstructorsConstructorDescriptionCreates the Groovy parser configuration for the warnings plugins. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParser(GroovyParser parser) Adds a GroovyParser to the list without removing other parsers.Returns all registered Groovy parsers.booleanReturns whether the current user has the permission to edit the available Groovy parsers.protected voidbooleanReturns whether a parser with the specified ID does already exist.voiddeleteParser(String parserId) Removes a GroovyParser from the list by ID.doCheckConsoleLogScanningPermitted(boolean value) Called by jelly to validate the configured value that could be passed tosetConsoleLogScanningPermitted(boolean).static ParserConfigurationReturns the singleton instance of thisParserConfiguration.Returns the parser (wrapped into aAnalysisModelParserinstance) with the specified ID.Returns the list of available Groovy parsers.booleanSays if the admin has permitted groovy parsers to scan a build's console log.voidsetConsoleLogScanningPermitted(boolean consoleLogScanningPermitted) Sets whether or not the admin has permitted groovy parsers to scan a build's console log.voidsetParsers(List<GroovyParser> parsers) Sets the list of available Groovy parsers to the specified elements.Methods inherited from class io.jenkins.plugins.util.GlobalConfigurationItem
configure, load, readResolve, saveMethods inherited from class jenkins.model.GlobalConfiguration
all, configure, getDescriptor, getGlobalConfigPageMethods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, self, toArray, toList, toMap
-
Constructor Details
-
ParserConfiguration
public ParserConfiguration()Creates the Groovy parser configuration for the warnings plugins.
-
-
Method Details
-
getInstance
Returns the singleton instance of thisParserConfiguration.- Returns:
- the singleton instance
-
clearRepeatableProperties
protected void clearRepeatableProperties()- Overrides:
clearRepeatablePropertiesin classio.jenkins.plugins.util.GlobalConfigurationItem
-
getParsers
Returns the list of available Groovy parsers.- Returns:
- the Groovy parsers
-
setParsers
Sets the list of available Groovy parsers to the specified elements. Previously set parsers will be removed.- Parameters:
parsers- the new Groovy parsers
-
deleteParser
Removes a GroovyParser from the list by ID.- Parameters:
parserId- the ID of the Groovy parser to be deleted
-
addParser
Adds a GroovyParser to the list without removing other parsers.- Parameters:
parser- the new Groovy parser to be added
-
isConsoleLogScanningPermitted
public boolean isConsoleLogScanningPermitted()Says if the admin has permitted groovy parsers to scan a build's console log.- Returns:
- true if groovy parsers can scan the console, false if they are limited to only scanning files on the build node.
-
setConsoleLogScanningPermitted
@DataBoundSetter public void setConsoleLogScanningPermitted(boolean consoleLogScanningPermitted) Sets whether or not the admin has permitted groovy parsers to scan a build's console log.- Parameters:
consoleLogScanningPermitted- true if groovy parsers can scan the console, false if they are limited to only scanning files on the build node.
-
doCheckConsoleLogScanningPermitted
Called by jelly to validate the configured value that could be passed tosetConsoleLogScanningPermitted(boolean).- Parameters:
value- The current value.- Returns:
FormValidation.ok()if all is well, else a warning or error.
-
canEditParsers
public boolean canEditParsers()Returns whether the current user has the permission to edit the available Groovy parsers.- Returns:
trueif the user has the right,falseotherwise
-
getParser
Returns the parser (wrapped into aAnalysisModelParserinstance) with the specified ID.- Parameters:
id- the ID of the parser- Returns:
- the parser
- Throws:
NoSuchElementException- if there is no such parser with the given ID
-
contains
Returns whether a parser with the specified ID does already exist. Parser IDs are unique in a Jenkins instance.- Parameters:
id- the ID of the parser- Returns:
trueif there is already a parser with the ID,falseotherwise
-
asListBoxModel
Returns all registered Groovy parsers. These are packed into aListBoxModelin order to show them in the list box of the config.jelly view part.- Returns:
- the model of the list box
-