public final class ConcourseCompiler
extends Compiler
Compiler for Concourse.| Modifier and Type | Method and Description |
|---|---|
AbstractSyntaxTree |
compile(Command command,
Multimap<String,Object> data)
|
List<AbstractSyntaxTree> |
compile(List<Command> commands,
Multimap<String,Object> data)
|
List<AbstractSyntaxTree> |
compile(String ccl,
Multimap<String,Object> data) |
boolean |
evaluate(ConditionTree tree,
Association data)
Return
true if the data is described by the condition
encapsulated in the tree. |
boolean |
evaluate(ConditionTree tree,
Multimap<String,Object> data)
Return
true if the data is described by the condition
encapsulated in the tree. |
static ConcourseCompiler |
get()
Return a
ConcourseCompiler. |
AbstractSyntaxTree |
parse(Criteria criteria)
Parse the criteria. |
AbstractSyntaxTree |
parse(Criteria criteria,
Multimap<String,Object> data)
Parse the criteria, resolving
$variable value placeholders against data. |
AbstractSyntaxTree |
parse(TCriteria criteria)
Parse the typed
TSymbols carried by the criteria
into an AbstractSyntaxTree. |
AbstractSyntaxTree |
parse(TCriteria criteria,
Multimap<String,Object> data)
Parse the typed
TSymbols carried by the criteria
into an AbstractSyntaxTree, resolving $variable value
placeholders against data. |
public static ConcourseCompiler get()
ConcourseCompiler.ConcourseCompilerpublic AbstractSyntaxTree compile(Command command, Multimap<String,Object> data)
command - the Command to compiledata - the local data to bindAbstractSyntaxTree representing the commandpublic List<AbstractSyntaxTree> compile(List<Command> commands, Multimap<String,Object> data)
public List<AbstractSyntaxTree> compile(String ccl, Multimap<String,Object> data)
compile in class Compilerpublic final boolean evaluate(ConditionTree tree,
Association data)
true if the data is described by the condition
encapsulated in the tree.tree - the ConditionTree that represents the conditiondata - the data to test for adherences to the conditiontrue if the data is described by the criteria that has
been parsedpublic final boolean evaluate(ConditionTree tree,
Multimap<String,Object> data)
true if the data is described by the condition
encapsulated in the tree.tree - the ConditionTree that represents the conditiondata - the data to test for adherences to the conditiontrue if the data is described by the criteria that has
been parsedpublic final AbstractSyntaxTree parse(Criteria criteria)
Parse the criteria.criteria - the CriteriaAbstractSyntaxTree representing the criteriapublic final AbstractSyntaxTree parse(Criteria criteria, Multimap<String,Object> data)
Parse the criteria, resolving
$variable value placeholders against data.criteria - the Criteriadata - the Multimap of locally-bound valuesAbstractSyntaxTree representing the criteriapublic final AbstractSyntaxTree parse(TCriteria criteria)
TSymbols carried by the criteria
into an AbstractSyntaxTree.
Key names that collide with reserved CCL command keywords (e.g.,
select, find) are valid because no CCL text parsing
occurs.
criteria - the TCriteriaAbstractSyntaxTree representing the criteriaSyntaxException - if a $variable reference appears in a
value position (no local bindings are available)public final AbstractSyntaxTree parse(TCriteria criteria,
Multimap<String,Object> data)
TSymbols carried by the criteria
into an AbstractSyntaxTree, resolving $variable value
placeholders against data.
A value of the form $name is replaced with the value bound to
name in data; \$name denotes the literal
$name. Key names that collide with reserved CCL command keywords
(e.g., select, find) are valid because no CCL text
parsing occurs.
criteria - the TCriteriadata - the Multimap of locally-bound valuesAbstractSyntaxTree representing the criteriaSyntaxException - if a $variable reference has no binding
or has multiple bindings in data