Search in sources :

Example 1 with Type

use of com.dexels.navajo.document.stream.DataItem.Type in project navajo by Dexels.

the class ReactivePipe method typecheck.

public void typecheck() {
    Type current = source.sourceType();
    Optional<Type> last = Optional.empty();
    Optional<String> lastTransformer = Optional.empty();
    int index = 0;
    logger.info("# of transformers: " + transformers.size());
    for (Object reactiveTransformer : transformers) {
        logger.info("index: " + index++);
        if (reactiveTransformer instanceof ReactiveTransformer) {
            TransformerMetadata transformer = ((ReactiveTransformer) reactiveTransformer).metadata();
            // maybe return implicit transformer
            current = matchType(last, lastTransformer, current, transformer);
            lastTransformer = Optional.of(transformer.name());
            if (transformer.outType() == Type.DATA) {
                binaryMime = ((ReactiveTransformer) reactiveTransformer).mimeType();
            }
        } else {
            current = matchType(last, lastTransformer, current, new ImplicitTransformerMetadata());
            logger.info("Type checking implicit, from type: {} to type: {}", last, current);
            lastTransformer = Optional.of("implicit");
        }
        last = Optional.of(current);
    }
    logger.info("Final type: " + current);
}
Also used : Type(com.dexels.navajo.document.stream.DataItem.Type)

Aggregations

Type (com.dexels.navajo.document.stream.DataItem.Type)1