Class PipelineModelParameter

java.lang.Object
nz.org.riskscape.engine.model.ModelParameter
nz.org.riskscape.engine.pipeline.PipelineModelParameter

public class PipelineModelParameter extends nz.org.riskscape.engine.model.ModelParameter

A slightly more specialized ModelParameter that deals specifically with pipelines, i.e. each parameter ultimately needs to be turned back into a pipeline expression.

  • Constructor Summary

    Constructors
    Constructor
    Description
    PipelineModelParameter(nz.org.riskscape.engine.bind.Parameter parameter, nz.org.riskscape.engine.bind.ParameterTemplate template)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(String name, nz.org.riskscape.engine.bind.ParameterTemplate template)
     
    nz.org.riskscape.rl.ast.Expression
    getExpression(nz.org.riskscape.engine.bind.BoundParameters bound)
    Returns the bound value in Expression form.
    List<nz.org.riskscape.problem.Problem>
    validateExpression(nz.org.riskscape.engine.bind.BoundParameters bound)
    Validates the final expression before it gets inserted into the pipeline.
    withDefaultValue(nz.org.riskscape.engine.bind.BindingContext context, Object value)
    Updates the underlying Parameter with the default value.

    Methods inherited from class nz.org.riskscape.engine.model.ModelParameter

    getChoices, getDescription, getLabel, getName, getParameter, getProperties, getTemplate, getValue

    Methods inherited from class java.lang.Object

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

    • PipelineModelParameter

      public PipelineModelParameter(nz.org.riskscape.engine.bind.Parameter parameter, nz.org.riskscape.engine.bind.ParameterTemplate template)
  • Method Details

    • create

      public static PipelineModelParameter create(String name, nz.org.riskscape.engine.bind.ParameterTemplate template)
    • withDefaultValue

      public PipelineModelParameter withDefaultValue(nz.org.riskscape.engine.bind.BindingContext context, Object value)

      Updates the underlying Parameter with the default value. If no properties have been defined for the ParameterTemplate, then we can try to infer some basic properties from the default value, e.g. TypedProperty.NUMERIC.

    • getExpression

      public nz.org.riskscape.rl.ast.Expression getExpression(nz.org.riskscape.engine.bind.BoundParameters bound)

      Returns the bound value in Expression form. E.g. we can bind against a ResolvedBookmark value, but then we need to turn that bookmark object back into an expression that will slot into pipeline DSL

    • validateExpression

      public List<nz.org.riskscape.problem.Problem> validateExpression(nz.org.riskscape.engine.bind.BoundParameters bound)

      Validates the final expression before it gets inserted into the pipeline. This checks that any amendments we've made to the user's value are still valid.