use of com.dexels.navajo.reactive.api.ReactiveParameters in project navajo by Dexels.
the class ReactiveParseItem method materializeReactive.
private Operand materializeReactive() {
switch(type) {
case REACTIVE_SOURCE:
ReactiveSourceFactory sourceFactory = Reactive.finderInstance().getSourceFactory(name);
if (sourceFactory == null) {
throw new ReactiveParseException("No source found named: " + name);
}
return new Operand(sourceFactory.build(ReactiveParameters.of(sourceFactory, namedParams, unnamedParams)), Reactive.ReactiveItemType.REACTIVE_MAPPER.toString());
case REACTIVE_HEADER:
break;
case REACTIVE_MAPPER:
ReactiveMerger mergerFactory = Reactive.finderInstance().getMergerFactory(name);
ReactiveParameters mergeParameters = ReactiveParameters.of(mergerFactory, namedParams, unnamedParams);
return new Operand(mergerFactory.execute(mergeParameters), Reactive.ReactiveItemType.REACTIVE_MAPPER.toString());
case REACTIVE_TRANSFORMER:
ReactiveTransformerFactory transformerFactory = Reactive.finderInstance().getTransformerFactory(name);
List<ReactiveParseProblem> problems = new ArrayList<>();
ReactiveParameters transParameters = ReactiveParameters.of(transformerFactory, namedParams, unnamedParams);
// TODO problems?
return new Operand(transformerFactory.build(problems, transParameters), Reactive.ReactiveItemType.REACTIVE_MAPPER.toString());
default:
break;
}
// TODO rather throw something
return null;
}
Aggregations