JsonNode applyDynamicTransformer(JsonNode json, JsonNode patch) throws IOException {
String clazz = patch.findPath(TRANSFORMER).textValue();
if (clazz != null) {
try {
final DynamicTransformer dynamicTransformer = (DynamicTransformer) Class.forName(getClass().getPackage().getName() + ".transform." + clazz).newInstance();
return dynamicTransformer.transform(json);
} catch (Exception e) {
throw new RuntimeException("error in json patch could not instantiate / find dynamic transformer", e);
}
}
return json;