public JsonObject convert(final Object attribute) {
if (attribute != null && (attribute instanceof String || attribute instanceof JsonNode)) {
try {
final Constructor<? extends JsonObject> constructor = this.clazz.getDeclaredConstructor();
final JsonObject jsonObject = constructor.newInstance();
jsonObject.buildFrom(attribute);
return jsonObject;
} catch (final Exception e) {
logger.error("Cannot build JsonObject : {}", e, this.clazz);
}
}