private static <T> FieldInfo<T> getFieldInfo(
final DataWriter dataWriter,
final PersistentValue<T> fieldValue,
final T entry,
final VisibilityWriter<T> customFieldVisibilityWriter ) {
final FieldWriter fieldWriter = dataWriter.getWriter(fieldValue.getId());
final FieldVisibilityHandler<T, Object> customVisibilityHandler = customFieldVisibilityWriter.getFieldVisibilityHandler(fieldValue.getId());
if (fieldWriter != null) {
final Object value = fieldValue.getValue();
return new FieldInfo<T>(
fieldValue,
fieldWriter.writeField(value),
merge(
customVisibilityHandler.getVisibility(
entry,
fieldValue.getId(),
value),
fieldWriter.getVisibility(
entry,
fieldValue.getId(),
value)));
}
else if (fieldValue.getValue() != null) {