public class ClasspathFunction extends Object implements QueryEnvironment.QueryFunction<QueryTarget,QueryBuildTarget>
expr ::= CLASSPATH '(' expr ')'
| CLASSPATH '(' expr ',' INTEGER ')'
Constructor and Description |
---|
ClasspathFunction() |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableSet<QueryTarget> |
eval(QueryEvaluator<QueryBuildTarget> evaluator,
QueryEnvironment<QueryBuildTarget> graphEnhancementQueryEnvironment,
com.google.common.collect.ImmutableList<QueryEnvironment.Argument<QueryBuildTarget>> args)
Called when a user-defined function is to be evaluated.
|
com.google.common.collect.ImmutableList<QueryEnvironment.ArgumentType> |
getArgumentTypes()
The types of the arguments of the function.
|
int |
getMandatoryArguments()
The number of arguments that are required.
|
String |
getName()
Name of the function as it appears in the query language.
|
public String getName()
QueryEnvironment.QueryFunction
getName
in interface QueryEnvironment.QueryFunction<QueryTarget,QueryBuildTarget>
public int getMandatoryArguments()
QueryEnvironment.QueryFunction
This should be greater than or equal to zero and at smaller than or equal to the length of
the list returned by QueryEnvironment.QueryFunction.getArgumentTypes()
.
getMandatoryArguments
in interface QueryEnvironment.QueryFunction<QueryTarget,QueryBuildTarget>
public com.google.common.collect.ImmutableList<QueryEnvironment.ArgumentType> getArgumentTypes()
QueryEnvironment.QueryFunction
getArgumentTypes
in interface QueryEnvironment.QueryFunction<QueryTarget,QueryBuildTarget>
public com.google.common.collect.ImmutableSet<QueryTarget> eval(QueryEvaluator<QueryBuildTarget> evaluator, QueryEnvironment<QueryBuildTarget> graphEnhancementQueryEnvironment, com.google.common.collect.ImmutableList<QueryEnvironment.Argument<QueryBuildTarget>> args) throws QueryException
QueryEnvironment.QueryFunction
eval
in interface QueryEnvironment.QueryFunction<QueryTarget,QueryBuildTarget>
graphEnhancementQueryEnvironment
- must implement GraphEnhancementQueryEnvironment
or you will get a runtime ClassCastException
.evaluator
- the evaluator for evaluating argument expressions.args
- the input arguments. These are type-checked against the specification returned by
QueryEnvironment.QueryFunction.getArgumentTypes()
and QueryEnvironment.QueryFunction.getMandatoryArguments()
Set
to
enable actual implementation to avoid making unnecessary copies, but resulting set is not
supposed to be mutated afterwards so implementation is ok to return ImmutableSet
.QueryException