use of com.dexels.navajo.reactive.api.ReactiveTransformer in project navajo by Dexels.
the class ASTPipeDefinition method transformerElements.
@SuppressWarnings("unchecked")
private List<Object> transformerElements(List<String> problems, String originalExpression, Function<String, FunctionClassification> functionClassifier, Function<String, Optional<Node>> mapResolver) {
int count = jjtGetNumChildren();
List<Object> pipeElements = new ArrayList<>();
for (int i = (partial ? 0 : 1); i < count; i++) {
ContextExpression interpretToLambda = jjtGetChild(i).interpretToLambda(problems, originalExpression, functionClassifier, mapResolver);
Object result = interpretToLambda.apply().value;
if (result instanceof Function) {
Function<StreamScriptContext, Function<DataItem, DataItem>> merger = (Function<StreamScriptContext, Function<DataItem, DataItem>>) result;
pipeElements.add(merger);
} else if (result instanceof ReactiveTransformer) {
ReactiveTransformer transformer = (ReactiveTransformer) result;
pipeElements.add(transformer);
} else {
logger.warn("huh? {}", result);
// something weird
}
}
return pipeElements;
}
Aggregations