|| source instanceof org.codehaus.jettison.json.JSONObject
|| source instanceof org.codehaus.jettison.json.JSONArray) {
try {
sink.write(source.toString().getBytes("UTF-8"));
} catch (Exception e) {
throw new TransformationException(e);
}
} else {
ObjectMapper mapper = JacksonHelper.createObjectMapper(source.getClass());
try {
mapper.writeValue(sink, source);
} catch (Throwable e) {
throw new TransformationException(e);
}
}
}
}