use of org.talend.components.netsuite.avro.converter.NullConverter in project components by Talend.
the class NsObjectTransducer method getValueConverter.
/**
* Get value converter for given field descriptor.
*
* @param fieldDesc field descriptor
* @return value converter
*/
public AvroConverter<?, ?> getValueConverter(FieldDesc fieldDesc) {
Class<?> valueClass;
if (fieldDesc instanceof CustomFieldDesc) {
CustomFieldDesc customFieldDesc = (CustomFieldDesc) fieldDesc;
CustomFieldRefType customFieldRefType = customFieldDesc.getCustomFieldType();
valueClass = getCustomFieldValueConverterTargetClass(customFieldRefType);
} else {
valueClass = fieldDesc.getValueType();
}
AvroConverter<?, ?> converter = null;
if (valueClass != null) {
converter = getValueConverter(valueClass);
}
if (converter == null) {
converter = new NullConverter(valueClass, null);
}
return converter;
}
Aggregations