Search in sources :

Example 1 with PartitionMapper

use of org.talend.sdk.component.api.input.PartitionMapper in project component-runtime by Talend.

the class ModelVisitorTest method visit.

private List<String> visit(final Class<?> type) {
    final ModelVisitor visitor = new ModelVisitor();
    final List<String> tracker = new ArrayList<>();
    Stream.of(type.getClasses()).sorted(Comparator.comparing(Class::getName)).forEach(nested -> visitor.visit(nested, new ModelListener() {

        @Override
        public void onPartitionMapper(final Class<?> type, final PartitionMapper partitionMapper) {
            tracker.add("@PartitionMapper(" + type.getName() + ")");
        }

        @Override
        public void onEmitter(final Class<?> type, final Emitter emitter) {
            tracker.add("@Emitter(" + type.getName() + ")");
        }

        @Override
        public void onProcessor(final Class<?> type, final Processor processor) {
            tracker.add("@Processor(" + type.getName() + ")");
        }
    }, true));
    return tracker;
}
Also used : PartitionMapper(org.talend.sdk.component.api.input.PartitionMapper) Emitter(org.talend.sdk.component.api.input.Emitter) Processor(org.talend.sdk.component.api.processor.Processor) ModelVisitor(org.talend.sdk.component.runtime.visitor.ModelVisitor) ArrayList(java.util.ArrayList) ModelListener(org.talend.sdk.component.runtime.visitor.ModelListener)

Aggregations

ArrayList (java.util.ArrayList)1 Emitter (org.talend.sdk.component.api.input.Emitter)1 PartitionMapper (org.talend.sdk.component.api.input.PartitionMapper)1 Processor (org.talend.sdk.component.api.processor.Processor)1 ModelListener (org.talend.sdk.component.runtime.visitor.ModelListener)1 ModelVisitor (org.talend.sdk.component.runtime.visitor.ModelVisitor)1