/** * INTERNAL: * Replace the client value holder with the server value holder after copying some of the settings from * the client value holder. */ public void mergeRemoteValueHolder(Object clientSideDomainObject, Object serverSideDomainObject, MergeManager mergeManager) { getMapping().setAttributeValueInObject(clientSideDomainObject, serverSideDomainObject); }
/** * INTERNAL: * Set the "real" value of the attribute to attributeValue. */ public void setRealAttributeValueInObject(Object target, Object attributeValue) { this.getMapping().setAttributeValueInObject(target, attributeValue); }
/** * INTERNAL: * Set the "real" value of the attribute to attributeValue. */ public void setRealAttributeValueInObject(Object target, Object attributeValue) { this.getMapping().setAttributeValueInObject(target, attributeValue); }
/** * INTERNAL: * Replace the client value holder with the server value holder after copying some of the settings from * the client value holder. */ public void mergeRemoteValueHolder(Object clientSideDomainObject, Object serverSideDomainObject, MergeManager mergeManager) { getMapping().setAttributeValueInObject(clientSideDomainObject, serverSideDomainObject); }
/** * INTERNAL: * Set the "real" value of the attribute to attributeValue. */ public void setRealAttributeValueInObject(Object target, Object attributeValue) { this.getMapping().setAttributeValueInObject(target, attributeValue); }
/** * INTERNAL: * Replace the client value holder with the server value holder after copying some of the settings from * the client value holder. */ public void mergeRemoteValueHolder(Object clientSideDomainObject, Object serverSideDomainObject, MergeManager mergeManager) { getMapping().setAttributeValueInObject(clientSideDomainObject, serverSideDomainObject); }
/** * INTERNAL: * Iterate over the specified attribute value. */ public void iterateOnAttributeValue(DescriptorIterator iterator, Object attributeValue) { if (attributeValue instanceof Proxy) { ProxyIndirectionHandler handler = (ProxyIndirectionHandler)Proxy.getInvocationHandler(attributeValue); ValueHolderInterface valueHolder = handler.getValueHolder(); iterator.iterateValueHolderForMapping(valueHolder, this.getMapping()); } else { if (attributeValue != null) { this.getMapping().iterateOnRealAttributeValue(iterator, attributeValue); } } }
/** * INTERNAL: * Iterate over the specified attribute value. */ public void iterateOnAttributeValue(DescriptorIterator iterator, Object attributeValue) { if (attributeValue instanceof Proxy) { ProxyIndirectionHandler handler = (ProxyIndirectionHandler)Proxy.getInvocationHandler(attributeValue); ValueHolderInterface valueHolder = handler.getValueHolder(); iterator.iterateValueHolderForMapping(valueHolder, this.getMapping()); } else { if (attributeValue != null) { this.getMapping().iterateOnRealAttributeValue(iterator, attributeValue); } } }
/** * INTERNAL: * Iterate over the specified attribute value. */ public void iterateOnAttributeValue(DescriptorIterator iterator, Object attributeValue) { if (attributeValue instanceof Proxy) { ProxyIndirectionHandler handler = (ProxyIndirectionHandler)Proxy.getInvocationHandler(attributeValue); ValueHolderInterface valueHolder = handler.getValueHolder(); iterator.iterateValueHolderForMapping(valueHolder, this.getMapping()); } else { if (attributeValue != null) { this.getMapping().iterateOnRealAttributeValue(iterator, attributeValue); } } }
/** * INTERNAL: * Verify that the parameter type of the attribute's set method is correct for the indirection policy. If it is * incorrect, add an exception to the integrity checker. In this case, the parameter type must be a * public interface. */ public void validateSetMethodParameterType(Class parameterType, IntegrityChecker checker) throws DescriptorException { if (!isValidType(parameterType)) { checker.handleError(DescriptorException.invalidSetMethodParameterTypeForProxyIndirection(parameterType, targetInterfaces, getMapping())); } }
/** * INTERNAL: * Verify that attribute type is correct for the indirection policy. If it is incorrect, add an exception to the * integrity checker. In this case, the attribute type must be contained in targetInterfaces. */ public void validateDeclaredAttributeType(Class attributeType, IntegrityChecker checker) throws DescriptorException { if (!isValidType(attributeType)) { checker.handleError(DescriptorException.invalidAttributeTypeForProxyIndirection(attributeType, targetInterfaces, getMapping())); } }
/** * INTERNAL: * Verify that attribute type is correct for the indirection policy. If it is incorrect, add an exception to the * integrity checker. In this case, the attribute type must be contained in targetInterfaces. */ public void validateDeclaredAttributeType(Class attributeType, IntegrityChecker checker) throws DescriptorException { if (!isValidType(attributeType)) { checker.handleError(DescriptorException.invalidAttributeTypeForProxyIndirection(attributeType, targetInterfaces, getMapping())); } }
/** * INTERNAL: * Verify that the return type of the attribute's get method is correct for the indirection policy. If it is * incorrect, add an exception to the integrity checker. In this case, the return type must be a * public interface. */ public void validateGetMethodReturnType(Class returnType, IntegrityChecker checker) throws DescriptorException { if (!isValidType(returnType)) { checker.handleError(DescriptorException.invalidGetMethodReturnTypeForProxyIndirection(returnType, targetInterfaces, getMapping())); } }
/** * INTERNAL: * Verify that attribute type is correct for the indirection policy. If it is incorrect, add an exception to the * integrity checker. In this case, the attribute type must be contained in targetInterfaces. */ public void validateDeclaredAttributeType(Class attributeType, IntegrityChecker checker) throws DescriptorException { if (!isValidType(attributeType)) { checker.handleError(DescriptorException.invalidAttributeTypeForProxyIndirection(attributeType, targetInterfaces, getMapping())); } }
/** * INTERNAL: * Verify that the return type of the attribute's get method is correct for the indirection policy. If it is * incorrect, add an exception to the integrity checker. In this case, the return type must be a * public interface. */ public void validateGetMethodReturnType(Class returnType, IntegrityChecker checker) throws DescriptorException { if (!isValidType(returnType)) { checker.handleError(DescriptorException.invalidGetMethodReturnTypeForProxyIndirection(returnType, targetInterfaces, getMapping())); } }
/** * INTERNAL: * Verify that the return type of the attribute's get method is correct for the indirection policy. If it is * incorrect, add an exception to the integrity checker. In this case, the return type must be a * public interface. */ public void validateGetMethodReturnType(Class returnType, IntegrityChecker checker) throws DescriptorException { if (!isValidType(returnType)) { checker.handleError(DescriptorException.invalidGetMethodReturnTypeForProxyIndirection(returnType, targetInterfaces, getMapping())); } }
/** * INTERNAL: * Verify that the parameter type of the attribute's set method is correct for the indirection policy. If it is * incorrect, add an exception to the integrity checker. In this case, the parameter type must be a * public interface. */ public void validateSetMethodParameterType(Class parameterType, IntegrityChecker checker) throws DescriptorException { if (!isValidType(parameterType)) { checker.handleError(DescriptorException.invalidSetMethodParameterTypeForProxyIndirection(parameterType, targetInterfaces, getMapping())); } }
/** * INTERNAL: * Verify that the parameter type of the attribute's set method is correct for the indirection policy. If it is * incorrect, add an exception to the integrity checker. In this case, the parameter type must be a * public interface. */ public void validateSetMethodParameterType(Class parameterType, IntegrityChecker checker) throws DescriptorException { if (!isValidType(parameterType)) { checker.handleError(DescriptorException.invalidSetMethodParameterTypeForProxyIndirection(parameterType, targetInterfaces, getMapping())); } }
/** * INTERNAL: * Return a backup clone of the attribute. */ public Object backupCloneAttribute(Object attributeValue, Object clone, Object backup, UnitOfWorkImpl unitOfWork) { if (!(attributeValue instanceof Proxy)) { return this.getMapping().buildBackupCloneForPartObject(attributeValue, clone, backup, unitOfWork); } ProxyIndirectionHandler handler = (ProxyIndirectionHandler)Proxy.getInvocationHandler(attributeValue); ValueHolderInterface unitOfWorkValueHolder = handler.getValueHolder(); ValueHolderInterface backupValueHolder = null; if ((!(unitOfWorkValueHolder instanceof UnitOfWorkValueHolder)) || unitOfWorkValueHolder.isInstantiated()) { backupValueHolder = (ValueHolderInterface) super.backupCloneAttribute(unitOfWorkValueHolder, clone, backup, unitOfWork); } else { // CR#2852176 Use a BackupValueHolder to handle replacing of the original. backupValueHolder = new BackupValueHolder(unitOfWorkValueHolder); ((UnitOfWorkValueHolder)unitOfWorkValueHolder).setBackupValueHolder((BackupValueHolder) backupValueHolder); } return ProxyIndirectionHandler.newProxyInstance(attributeValue.getClass(), targetInterfaces, backupValueHolder); }
/** * INTERNAL: * Return a backup clone of the attribute. */ public Object backupCloneAttribute(Object attributeValue, Object clone, Object backup, UnitOfWorkImpl unitOfWork) { if (!(attributeValue instanceof Proxy)) { return this.getMapping().buildBackupCloneForPartObject(attributeValue, clone, backup, unitOfWork); } ProxyIndirectionHandler handler = (ProxyIndirectionHandler)Proxy.getInvocationHandler(attributeValue); ValueHolderInterface unitOfWorkValueHolder = handler.getValueHolder(); ValueHolderInterface backupValueHolder = null; if ((!(unitOfWorkValueHolder instanceof UnitOfWorkValueHolder)) || unitOfWorkValueHolder.isInstantiated()) { backupValueHolder = (ValueHolderInterface) super.backupCloneAttribute(unitOfWorkValueHolder, clone, backup, unitOfWork); } else { // CR#2852176 Use a BackupValueHolder to handle replacing of the original. backupValueHolder = new BackupValueHolder(unitOfWorkValueHolder); ((UnitOfWorkValueHolder)unitOfWorkValueHolder).setBackupValueHolder((BackupValueHolder) backupValueHolder); } return ProxyIndirectionHandler.newProxyInstance(attributeValue.getClass(), targetInterfaces, backupValueHolder); }