use of com.netflix.metacat.common.server.connectors.ConnectorTypeConverter in project metacat by Netflix.
the class DozerJsonTypeConverter method convert.
@Override
public Object convert(final Object existingDestinationFieldValue, final Object sourceFieldValue, final Class<?> destinationClass, final Class<?> sourceClass) {
JsonNode result = null;
final Type type = (Type) sourceFieldValue;
final ConnectorTypeConverter typeConverter;
try {
typeConverter = this.typeConverterFactory.get(MetacatContextManager.getContext().getDataTypeContext());
} catch (final Exception e) {
throw new IllegalStateException("Unable to get a type converter", e);
}
try {
result = typeConverter.fromMetacatTypeToJson(type);
} catch (final Exception ignored) {
// TODO: Handle exception.
}
return result;
}
Aggregations