Class DeclarativeValidatorContributor

java.lang.Object
org.jenkinsci.plugins.pipeline.modeldefinition.validator.DeclarativeValidatorContributor
All Implemented Interfaces:
ExtensionPoint

public abstract class DeclarativeValidatorContributor extends Object implements ExtensionPoint
Extension point for contributing additional ModelASTElement validation checks to ModelValidator runs. Override a validateElement method in your extension to have that check run at the end of normal validation. The new method will take both the relevant ModelASTElement and a possibly null FlowExecution for the current run, if there is one. Since validation can be performed outside of the context of a run, such as from the CLI or via the REST endpoints (as used by the editor, e.g.), you must handle a null execution cleanly. Each method should return a string containing the error message if validation fails, and null otherwise.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface hudson.ExtensionPoint

    ExtensionPoint.LegacyInstancesAreScopedToHudson
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    all()
    boolean
    Implementations default to not optional.
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTAgent agent, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBranch branch, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildCondition buildCondition, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildConditionsContainer container, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildParameter buildParameter, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildParameters buildParameters, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    final String
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    Fallback for any unknown element type.
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTEnvironment environment, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTInternalFunctionCall call, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTLibraries libraries, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTMethodCall methodCall, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTOption jobProperty, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTOptions properties, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPipelineDef pipelineDef, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPostBuild postBuild, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPostStage post, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStage stage, boolean isNested, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStages stages, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStep step, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTTools tools, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTTrigger trigger, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTTriggers triggers, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTValue value, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTWhenCondition condition, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElement(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTWhen when, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTAgent element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBranch element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildCondition element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildConditionsContainer element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildParameter element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildParameters element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    final List<String>
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTEnvironment element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTInternalFunctionCall element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTLibraries element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTMethodCall element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTOption element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTOptions element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPipelineDef element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPostBuild element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPostStage element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStage element, boolean isNested, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStages element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStep element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTTools element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTTrigger element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTTriggers element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTValue element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTWhenCondition element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     
    validateElementAll(org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTWhen element, org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DeclarativeValidatorContributor

      public DeclarativeValidatorContributor()
  • Method Details

    • isOptional

      public boolean isOptional()
      Implementations default to not optional. Can be overridden.
    • validateElement

      @CheckForNull public final String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
      Fallback for any unknown element type. Always returns true, cannot be overridden.
    • validateElementAll

      @NonNull public final List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTElement element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTAgent agent, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTAgent element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBranch branch, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBranch element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildConditionsContainer container, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildConditionsContainer element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPostBuild postBuild, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPostBuild element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPostStage post, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPostStage element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildCondition buildCondition, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildCondition element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTEnvironment environment, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTEnvironment element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTTools tools, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTTools element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStep step, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStep element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTWhen when, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTWhen element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTMethodCall methodCall, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTMethodCall element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTOptions properties, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTOptions element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTTriggers triggers, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTTriggers element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildParameters buildParameters, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildParameters element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTOption jobProperty, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTOption element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTTrigger trigger, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTTrigger element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildParameter buildParameter, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildParameter element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPipelineDef pipelineDef, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTPipelineDef element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStage stage, boolean isNested, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStage element, boolean isNested, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStages stages, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTStages element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTLibraries libraries, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTLibraries element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTWhenCondition condition, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTWhenCondition element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTInternalFunctionCall call, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTInternalFunctionCall element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElement

      @CheckForNull public String validateElement(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTValue value, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • validateElementAll

      @NonNull public List<String> validateElementAll(@NonNull org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTValue element, @CheckForNull org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
    • all

      Returns:
      a list of all DeclarativeValidatorContributors registered.`