use of com.bazaarvoice.jolt.Sortr in project camel by apache.
the class JoltEndpoint method getTransform.
private synchronized Transform getTransform() throws Exception {
if (transform == null) {
if (log.isDebugEnabled()) {
String path = getResourceUri();
log.debug("Jolt content read from resource {} with resourceUri: {} for endpoint {}", new Object[] { getResourceUri(), path, getEndpointUri() });
}
// Sortr does not require a spec
if (this.transformDsl == JoltTransformType.Sortr) {
this.transform = new Sortr();
} else {
// getResourceAsInputStream also considers the content cache
Object spec = JsonUtils.jsonToObject(getResourceAsInputStream());
switch(this.transformDsl) {
case Shiftr:
this.transform = new Shiftr(spec);
break;
case Defaultr:
this.transform = new Defaultr(spec);
break;
case Removr:
this.transform = new Removr(spec);
break;
case Chainr:
default:
this.transform = Chainr.fromSpec(spec);
break;
}
}
}
return transform;
}
use of com.bazaarvoice.jolt.Sortr in project nifi by apache.
the class TestTransformFactory method testGetSortTransform.
@Test
public void testGetSortTransform() throws Exception {
JoltTransform transform = TransformFactory.getTransform(getClass().getClassLoader(), "jolt-transform-sort", null);
assertTrue(transform instanceof Sortr);
}