/* a primitive field */
AbstractConverter binaryConverter;
binaryConverter = (AbstractConverter) helperBinaryConversion
.fromBinary(binary, offset, fieldType);
if (!binaryConverter.valueDefinedFromBinary) {
throw new ObjectIOException(
"field value must be defined");
}
final Object fieldValue = binaryConverter.objectFromBinary;
binaryConverter.objectFromBinary = null;// NOPMD
/* primitive not persisted */
fieldValueAndPersistInfo = objectIOManager
.getOrCreateObjectPersistInfoOfObject(fieldValue,
false, fieldType, Boolean.FALSE);
// offset += helperBinaryConversion.byteSize(type);
offset += fieldType.getBinarySize();
} else if (helperBinaryConversion.getType(binary, offset) ==
/* */HelperBinaryConversion.REFERENCE_TYPE) {
/* a reference field */
fieldValueAndPersistInfo = referenceInput.fromBinary(
binary, offset);
offset += HelperBinaryConversion.REFERENCE_NULLABLE_BYTE_SIZE;
if (!fieldValueAndPersistInfo.valueDefined) {
throw new ObjectIOException(
"field value must be defined");
}
} else {
/* a basic field */
AbstractConverter binaryConverter;
try {
binaryConverter = (AbstractConverter) helperBinaryConversion
.fromBinary(binary, offset);
} catch (BinaryConverterException exception) {
throw new ObjectIOException(exception);
}
// offset = binaryConverter.getOffsetFromBinary();
offset = binaryConverter.offsetFromBinary;
final Object fieldValue;
final ClassInfo fieldValueClassInfo;
if (binaryConverter.valueDefinedFromBinary) {
fieldValue = binaryConverter.objectFromBinary;
binaryConverter.objectFromBinary = null;// NOPMD
if (fieldValue == null) {
fieldValueClassInfo = ClassInfo.NULL;
} else {
fieldValueClassInfo = classInfoFactory
.getNoProxyClassInfo(fieldValue.getClass());
}
} else {
fieldValue = null;
fieldValueClassInfo = ClassInfo.NULL;
}
fieldValueAndPersistInfo = objectIOManager
.getOrCreateObjectPersistInfoOfObject(fieldValue,
false, fieldValueClassInfo, false);
}
} else {
fieldValueAndPersistInfo = ObjectAndPersistInfo.NULL;
}
} catch (BinaryConverterException exception) {
String declaringClassName;
declaringClassName = fieldInfo.getDeclaringClassName();
throw new ObjectIOException("for field \""
+ fieldInfo.getFieldName() + "\", field declaring class \""
+ declaringClassName + "\", object class \""
+ objectAndPersistInfo.objectClassInfo + "\"", exception);
} catch (ObjectIODataRecordNotFoundException exception) {
String declaringClassName;
declaringClassName = fieldInfo.getDeclaringClassName();
throw new ObjectIODataRecordNotFoundException("for field \""
+ fieldInfo.getFieldName() + "\", field declaring class \""
+ declaringClassName + "\", object class \""
+ objectAndPersistInfo.objectClassInfo + "\"", exception);
} catch (ClassInfoException exception) {
throw new ObjectIOException(exception);
}
setObjectFieldValue(objectAndPersistInfo, originalValue, index,
fieldInfo, fieldType, fieldValueAndPersistInfo);
return offset;