Class BasePipelineChange<T>

All Implemented Interfaces:
Direct Known Subclasses:
AppendStepChange, StartChainChange

public abstract class BasePipelineChange<T> extends Object implements PipelineChange

Base class for any PipelineChange that follows a standard string -> ast -> validate -> update pattern

  • Constructor Details

    • BasePipelineChange

      public BasePipelineChange(Answer answer)
  • Method Details

    • make

      public final<IncrementalBuildState> make(IncrementalBuildState state)
      Description copied from interface: PipelineChange

      Attempt to create a new IncrementalBuildState for this change

      Specified by:
      make in interface PipelineChange
      a new IncrementalBuildState with this change applied
    • validateParsedSegment

      protected abstract T validateParsedSegment( declaration) throws BadPipelineChangeException

      Validate that the parsed pipeline segment is ok to use in this kind of change.

      the interesting bit of the pipeline, e.g. a single step, a step chain, whatever
      BadPipelineChangeException - if it's invalid - it has been coded badly (not a user error)
    • updateAst

      protected abstract updateAst(IncrementalBuildState state, astSegment, T validated)

      Build a new AST that is the result of this change

      state - the previous build state that we are building upon
      astSegment - the segment that was parsed and validated. This is not the previous state's ast.
      validated - the chunk of the parsed segment that the validate routine method returned - this is often the node of interest that ultimately gets added to the previous state's ast
      a pipeline ast to be used in the next IncrementalBuildState
    • getSource

      protected abstract String getSource()

      TODO maybe break this up in to something else?

      the source code that was assembled to be parsed in to a PipelineDeclaration
    • getAnswer

      public Answer getAnswer()
      Specified by:
      getAnswer in interface PipelineChange
      the Answer that was ultimately responsible for this PipelineChange being introduced. Note that this might not be the only thing that predicated this change, but it is the last thing that caused it (the straw that broke the camel's back, so to speak)