/** * Get the value from the wrapped value holder, instantiating it * if necessary, and clone it. */ protected Object instantiate() { Object originalAttributeValue; Object cloneAttributeValue; if (isSerializedRemoteUnitOfWorkValueHolder()) { originalAttributeValue = getValueFromServerObject(); cloneAttributeValue = buildCloneFor(originalAttributeValue); } else { if (getUnitOfWork() == null) { throw ValidationException.instantiatingValueholderWithNullSession(); } cloneAttributeValue = instantiateImpl(); } // Set the value in the backup clone also. // In some cases we may want to force instantiation before the backup is built if (this.backupValueHolder != null) { this.backupValueHolder.setValue(buildBackupCloneFor(cloneAttributeValue)); } return cloneAttributeValue; }
/** * Get the value from the wrapped value holder, instantiating it * if necessary, and clone it. */ protected Object instantiate() { Object originalAttributeValue; Object cloneAttributeValue; if (isSerializedRemoteUnitOfWorkValueHolder()) { originalAttributeValue = getValueFromServerObject(); cloneAttributeValue = buildCloneFor(originalAttributeValue); } else { if (getUnitOfWork() == null) { throw ValidationException.instantiatingValueholderWithNullSession(); } cloneAttributeValue = instantiateImpl(); } // Set the value in the backup clone also. // In some cases we may want to force instantiation before the backup is built if (this.backupValueHolder != null) { this.backupValueHolder.setValue(buildBackupCloneFor(cloneAttributeValue)); } return cloneAttributeValue; }
/** * Get the value from the wrapped value holder, instantiating it * if necessary, and clone it. */ protected Object instantiate() { UnitOfWorkImpl unitOfWork; if (isSerializedRemoteUnitOfWorkValueHolder()) { unitOfWork = getRemoteUnitOfWork(); } else { unitOfWork = getUnitOfWork(); } if (unitOfWork == null){ throw ValidationException.instantiatingValueholderWithNullSession(); } Object originalAttributeValue; Object cloneAttributeValue; // the wrapped value holder is transient, so it will be null for a remote UOW if (isSerializedRemoteUnitOfWorkValueHolder()) { originalAttributeValue = getValueFromServerObject(); cloneAttributeValue = buildCloneFor(originalAttributeValue); } else { cloneAttributeValue = instantiateImpl(); } // Set the value in the backup clone also. // In some cases we may want to force instantiation before the backup is built if (getBackupValueHolder() != null) { getBackupValueHolder().setValue(buildBackupCloneFor(cloneAttributeValue)); } return cloneAttributeValue; }