}
private void replaceRead(ClassTransformation transformation, String fieldName, String fieldType,
String managerFieldName, String typeFieldName)
{
ApplicationState annotation = transformation.getFieldAnnotation(fieldName, ApplicationState.class);
String readMethodName = transformation.newMemberName("read", fieldName);
TransformMethodSignature readMethodSignature = new TransformMethodSignature(Modifier.PRIVATE, fieldType,
readMethodName, null, null);
String methodName = annotation.create() ? "get" : "getIfExists";
String body = format("return (%s) %s.%s(%s);", fieldType, managerFieldName, methodName, typeFieldName);
transformation.addMethod(readMethodSignature, body);