Search in sources :

Example 1 with StandardRecordPathEvaluationContext

use of org.apache.nifi.record.path.StandardRecordPathEvaluationContext in project nifi by apache.

the class RecordPathSegment method evaluate.

@Override
public final RecordPathResult evaluate(final Record record) {
    final RecordPathEvaluationContext context = new StandardRecordPathEvaluationContext(record);
    final Stream<FieldValue> selectedFields = evaluate(context);
    return new RecordPathResult() {

        @Override
        public String getPath() {
            return RecordPathSegment.this.getPath();
        }

        @Override
        public Stream<FieldValue> getSelectedFields() {
            return selectedFields;
        }
    };
}
Also used : RecordPathResult(org.apache.nifi.record.path.RecordPathResult) FieldValue(org.apache.nifi.record.path.FieldValue) StandardRecordPathEvaluationContext(org.apache.nifi.record.path.StandardRecordPathEvaluationContext) StandardRecordPathEvaluationContext(org.apache.nifi.record.path.StandardRecordPathEvaluationContext) RecordPathEvaluationContext(org.apache.nifi.record.path.RecordPathEvaluationContext)

Example 2 with StandardRecordPathEvaluationContext

use of org.apache.nifi.record.path.StandardRecordPathEvaluationContext in project nifi by apache.

the class RecordPathSegment method evaluate.

@Override
public final RecordPathResult evaluate(final Record record, final FieldValue contextNode) {
    final RecordPathEvaluationContext context = new StandardRecordPathEvaluationContext(record);
    context.setContextNode(contextNode);
    final Stream<FieldValue> selectedFields = evaluate(context);
    return new RecordPathResult() {

        @Override
        public String getPath() {
            return RecordPathSegment.this.getPath();
        }

        @Override
        public Stream<FieldValue> getSelectedFields() {
            return selectedFields;
        }
    };
}
Also used : RecordPathResult(org.apache.nifi.record.path.RecordPathResult) FieldValue(org.apache.nifi.record.path.FieldValue) StandardRecordPathEvaluationContext(org.apache.nifi.record.path.StandardRecordPathEvaluationContext) StandardRecordPathEvaluationContext(org.apache.nifi.record.path.StandardRecordPathEvaluationContext) RecordPathEvaluationContext(org.apache.nifi.record.path.RecordPathEvaluationContext)

Aggregations

FieldValue (org.apache.nifi.record.path.FieldValue)2 RecordPathEvaluationContext (org.apache.nifi.record.path.RecordPathEvaluationContext)2 RecordPathResult (org.apache.nifi.record.path.RecordPathResult)2 StandardRecordPathEvaluationContext (org.apache.nifi.record.path.StandardRecordPathEvaluationContext)2