Package nz.org.riskscape.engine.pipeline
Class PipelineBuilder
java.lang.Object
nz.org.riskscape.rl.ExpressionParser
nz.org.riskscape.engine.pipeline.PipelineBuilder
public class PipelineBuilder
extends nz.org.riskscape.rl.ExpressionParser
Traverses a PipelineDeclaration
to produce a Pipeline
.
TODO revist all of these error messages, including the nesting, as part of GL#470
-
Nested Class Summary
-
Field Summary
Fields inherited from class nz.org.riskscape.rl.ExpressionParser
IDENTIFIERS, INSTANCE, KEY_IDENTIFIERS, LEADING_TOKENS, LITERALS
-
Constructor Summary
ConstructorDescriptionPipelineBuilder
(nz.org.riskscape.engine.bind.BindingContext context) Construct a pipeline builder from the given context, looking up available steps from the contextPipelineBuilder
(nz.org.riskscape.engine.pipeline.PipelineSteps availableSteps, nz.org.riskscape.engine.bind.BindingContext bindingContext) -
Method Summary
Modifier and TypeMethodDescriptionnz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.pipeline.Pipeline>
buildPipeline
(nz.org.riskscape.engine.resource.Resource source) Parse the pipeline from the given resourcenz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.pipeline.Pipeline>
buildPipeline
(nz.org.riskscape.pipeline.ast.PipelineDeclaration ast, String resourceName) Build a pipeline from the given AST.nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.pipeline.Pipeline>
buildPipeline
(nz.org.riskscape.pipeline.ast.PipelineDeclaration ast, nz.org.riskscape.engine.resource.Resource pipelineSource) Builds aPipeline
from ast.void
toDsl
(nz.org.riskscape.engine.pipeline.Pipeline pipeline, PrintStream writer) Writes thePipeline
s definition in Pipeline DSL format to the print writerMethods inherited from class nz.org.riskscape.rl.ExpressionParser
checkForParameters, lex, parse, parseAllowParameters, parseExpression, parseFunctionExpression, parseOr, parsePropertyExpression, parseString, toList, toStruct
-
Constructor Details
-
PipelineBuilder
public PipelineBuilder(nz.org.riskscape.engine.bind.BindingContext context) Construct a pipeline builder from the given context, looking up available steps from the context
-
PipelineBuilder
public PipelineBuilder(nz.org.riskscape.engine.pipeline.PipelineSteps availableSteps, nz.org.riskscape.engine.bind.BindingContext bindingContext)
-
-
Method Details
-
buildPipeline
public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.pipeline.Pipeline> buildPipeline(nz.org.riskscape.pipeline.ast.PipelineDeclaration ast, String resourceName) Build a pipeline from the given AST.
- Parameters:
ast
- the AST to buildresourceName
- something sensible to display in any pipeline errors. This should be a valid URI (i.e. have dashes, not spaces)- Returns:
- built pipeline or problems encountered
-
buildPipeline
public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.pipeline.Pipeline> buildPipeline(nz.org.riskscape.pipeline.ast.PipelineDeclaration ast, nz.org.riskscape.engine.resource.Resource pipelineSource) Builds a
Pipeline
from ast.- Parameters:
ast
- pipeline declarationpipelineSource
- the resource that ast came from, used for problem locations- Returns:
- built pipeline or problems encountered
-
buildPipeline
public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.pipeline.Pipeline> buildPipeline(nz.org.riskscape.engine.resource.Resource source) Parse the pipeline from the given resource
- Parameters:
source
- a Resource to fetch text data from- Returns:
- a
Pipeline
, or problems describing why parsing/building failed
-
toDsl
Writes the
Pipeline
s definition in Pipeline DSL format to the print writer- Parameters:
pipeline
- to write as pipeline DSLwriter
- to write to
-