Class StepDeclaration
- All Implemented Interfaces:
AST,PipelineAST
- Direct Known Subclasses:
StepDefinition,StepReference
AST for a single step.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TokenThe first identifier that starts this step declaration.The identifier that specifies a named input which accepts the previous step in the chain's output, e.g. -
Constructor Summary
ConstructorsConstructorDescriptionStepDeclaration(Token identToken, Optional<Token> namedInputToken) Creates a newStepDeclarationinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidappendSource(StringBuilder appendTo) Implementers extend this to append their source to the given string builder.protected static voidappendSource(AST ast, StringBuilder appendTo) Helper method for appending the source of another ast element to a string builder, efficiently if possible.protected voidappendString(StringBuilder appendTo) Append a simplified string representation to the builder.protected booleanbooleangetIdent()The first identifier that starts this step declaration.Get the input name, if any, that the output should be directed to.The identifier that specifies a named input which accepts the previous step in the chain's output, e.g.inthashCode()final StringtoSource()final StringtoString()Returns a simplified view of the ast in a source-like fashion, but with a lot of details left out for concisenessMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface nz.org.riskscape.rl.ast.AST
getBoundary, isA, switchType, toSourceMethods inherited from interface nz.org.riskscape.rl.ast.PipelineAST
accept
-
Field Details
-
identToken
The first identifier that starts this step declaration. Will be either the name of the referenced step (StepReference) or the id of a step being defined (StepDefinition).
-
namedInputToken
The identifier that specifies a named input which accepts the previous step in the chain's output, e.g. the baz in
foo -> bar.baz. Valid for references and definitions.
-
-
Constructor Details
-
StepDeclaration
Creates a new
StepDeclarationinstance.- Parameters:
identToken- The first identifier that starts this step declaration. Will be either the name of the referenced step (StepReference) or the id of a step being defined (StepDefinition).namedInputToken- The identifier that specifies a named input which accepts the previous step in the chain's output, e.g. the baz infoo -> bar.baz. Valid for references and definitions.
-
-
Method Details
-
getNamedInput
Get the input name, if any, that the output should be directed to. Only applied to
StepReferences.- Returns:
- input name, if any
-
getIdent
- Returns:
- the string value of this declaration's identifier
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getIdentToken
The first identifier that starts this step declaration. Will be either the name of the referenced step (StepReference) or the id of a step being defined (StepDefinition).
-
getNamedInputToken
The identifier that specifies a named input which accepts the previous step in the chain's output, e.g. the baz in
foo -> bar.baz. Valid for references and definitions. -
appendSource
Helper method for appending the source of another ast element to a string builder, efficiently if possible.
-
toString
Returns a simplified view of the ast in a source-like fashion, but with a lot of details left out for conciseness
-
appendString
Append a simplified string representation to the builder. Default implementation uses appendSource. Subclasses can override to provide a more concise representation.
-
toSource
-
appendSource
Implementers extend this to append their source to the given string builder. Done via string builder to encourage a more efficient implementation than is possible with concatenating multiple toString calls that typically contruct a string builder anyway.
-