/** * INTERNAL: * Trigger the instantiation of the attribute if lazy. */ @Override public void instantiateAttribute(Object object, AbstractSession session) { this.indirectionPolicy.instantiateObject(object, getAttributeValueFromObject(object)); }
/** * INTERNAL: * Trigger the instantiation of the attribute if lazy. */ @Override public void instantiateAttribute(Object object, AbstractSession session) { this.indirectionPolicy.instantiateObject(object, getAttributeValueFromObject(object)); }
/** * INTERNAL: * The referenced object is checked if it is instantiated or not */ protected boolean areObjectsToBeProcessedInstantiated(Object object) { return this.indirectionPolicy.objectIsInstantiated(getAttributeValueFromObject(object)); }
/** * INTERNAL: * The referenced object is checked if it is instantiated or not */ protected boolean areObjectsToBeProcessedInstantiated(Object object) { return this.indirectionPolicy.objectIsInstantiated(getAttributeValueFromObject(object)); }
public Object buildFieldValue(Object instance, String fieldName, Session session) { if (null == instance) { return null; } QName qName = (QName)transformationMapping.getAttributeValueFromObject(instance); if (null == qName.getNamespaceURI()) { return qName.getLocalPart(); } else { String namespaceURI = qName.getNamespaceURI(); String prefix = namespaceResolver.resolveNamespaceURI(namespaceURI); if (null == prefix) { return qName.getLocalPart(); } else { return prefix + COLON + qName.getLocalPart(); } } } }
@Override public Object buildFieldValue(Object instance, String fieldName, Session session) { if (null == instance) { return null; } QName qName = (QName)transformationMapping.getAttributeValueFromObject(instance); if (null == qName.getNamespaceURI()) { return qName.getLocalPart(); } else { String namespaceURI = qName.getNamespaceURI(); String prefix = namespaceResolver.resolveNamespaceURI(namespaceURI); if (null == prefix) { return qName.getLocalPart(); } else { return prefix + COLON + qName.getLocalPart(); } } } }
public Object buildFieldValue(Object instance, String fieldName, Session session) { if (null == instance) { return null; } String value = (String) transformationMapping.getAttributeValueFromObject(instance); if(value == null){ return null; } int index = value.lastIndexOf(HASH); if (index > -1) { String namespaceURI = value.substring(0, index); if(null == namespaceResolver) { // If there is no NamespaceResolver, then assume the URI is in the default namespace return namespaceURI; } String prefix = namespaceResolver.resolveNamespaceURI(namespaceURI); if (prefix == null) { return namespaceURI; } return null; } else { return null; } }
public Object buildFieldValue(Object instance, String fieldName, Session session) { if (null == instance) { return null; } String value = (String) transformationMapping.getAttributeValueFromObject(instance); if(value == null){ return null; } int index = value.lastIndexOf(HASH); if (index > -1) { String namespaceURI = value.substring(0, index); if(null == namespaceResolver) { // If there is no NamespaceResolver, then assume the URI is in the default namespace return namespaceURI; } String prefix = namespaceResolver.resolveNamespaceURI(namespaceURI); if (prefix == null) { return namespaceURI; } return null; } else { return null; } }
/** * INTERNAL: * Trigger the instantiation of the attribute if lazy. */ public void instantiateAttribute(Object object, AbstractSession session) { getIndirectionPolicy().instantiateObject(object, getAttributeValueFromObject(object)); }
/** * INTERNAL: * Perform the iteration opperation on the iterators current objects attributes. * Only require if primitives are desired. */ @Override public void iterate(DescriptorIterator iterator) { Object attributeValue = getAttributeValueFromObject(iterator.getVisitedParent()); this.indirectionPolicy.iterateOnAttributeValue(iterator, attributeValue); }
/** * INTERNAL: * The referenced object is checked if it is instantiated or not */ protected boolean areObjectsToBeProcessedInstantiated(Object object) { return getIndirectionPolicy().objectIsInstantiated(getAttributeValueFromObject(object)); }
/** * INTERNAL: * Perform the iteration opperation on the iterators current objects attributes. * Only require if primitives are desired. */ @Override public void iterate(DescriptorIterator iterator) { Object attributeValue = getAttributeValueFromObject(iterator.getVisitedParent()); this.indirectionPolicy.iterateOnAttributeValue(iterator, attributeValue); }
/** * INTERNAL: * Perform the iteration opperation on the iterators current objects attributes. * Only require if primitives are desired. */ public void iterate(DescriptorIterator iterator) { Object attributeValue = getAttributeValueFromObject(iterator.getVisitedParent()); getIndirectionPolicy().iterateOnAttributeValue(iterator, attributeValue); }
/** * INTERNAL: * Clone the attribute from the clone and assign it to the backup. */ @Override public void buildBackupClone(Object clone, Object backup, UnitOfWorkImpl unitOfWork) { // If mapping is a no-attribute transformation mapping, do nothing if (isWriteOnly()) { return; } Object attributeValue = getAttributeValueFromObject(clone); Object clonedAttributeValue = this.indirectionPolicy.backupCloneAttribute(attributeValue, clone, backup, unitOfWork); setAttributeValueInObject(backup, clonedAttributeValue); }
/** * INTERNAL: * Clone the attribute from the original and assign it to the clone. */ @Override public void buildClone(Object original, CacheKey cacheKey, Object clone, Integer refreshCascade, AbstractSession cloningSession) { // If mapping is a no-attribute transformation mapping, do nothing if (isWriteOnly()) { return; } Object attributeValue = getAttributeValueFromObject(original); Object clonedAttributeValue = this.indirectionPolicy.cloneAttribute(attributeValue, original, cacheKey, clone, refreshCascade, cloningSession, false);// building clone from an original not a row. setAttributeValueInObject(clone, clonedAttributeValue); }
/** * INTERNAL: * Clone the attribute from the clone and assign it to the backup. */ @Override public void buildBackupClone(Object clone, Object backup, UnitOfWorkImpl unitOfWork) { // If mapping is a no-attribute transformation mapping, do nothing if (isWriteOnly()) { return; } Object attributeValue = getAttributeValueFromObject(clone); Object clonedAttributeValue = this.indirectionPolicy.backupCloneAttribute(attributeValue, clone, backup, unitOfWork); setAttributeValueInObject(backup, clonedAttributeValue); }
/** * INTERNAL: * Clone the attribute from the original and assign it to the clone. */ @Override public void buildClone(Object original, CacheKey cacheKey, Object clone, Integer refreshCascade, AbstractSession cloningSession) { // If mapping is a no-attribute transformation mapping, do nothing if (isWriteOnly()) { return; } Object attributeValue = getAttributeValueFromObject(original); Object clonedAttributeValue = this.indirectionPolicy.cloneAttribute(attributeValue, original, cacheKey, clone, refreshCascade, cloningSession, false);// building clone from an original not a row. setAttributeValueInObject(clone, clonedAttributeValue); }
/** * INTERNAL: * Clone the attribute from the original and assign it to the clone. */ public void buildClone(Object original, Object clone, UnitOfWorkImpl unitOfWork) { // If mapping is a no-attribute transformation mapping, do nothing if (isWriteOnly()) { return; } Object attributeValue = getAttributeValueFromObject(original); Object clonedAttributeValue; // If the mapping is read-only, a direct pass through of the value will be performed. // This is done because the method invocation is not possible as the row will be // empty and we have no way to clone the value. // Since the value cannot change anyway we just pass it through. if (isReadOnly() || !isMutable()) { clonedAttributeValue = attributeValue; } else { clonedAttributeValue = getIndirectionPolicy().cloneAttribute(attributeValue, original, clone, unitOfWork, false);// building clone from an original not a row. } setAttributeValueInObject(clone, clonedAttributeValue); }
/** * INTERNAL: * Clone the attribute from the clone and assign it to the backup. */ public void buildBackupClone(Object clone, Object backup, UnitOfWorkImpl unitOfWork) { // If mapping is a no-attribute transformation mapping, do nothing if (isWriteOnly()) { return; } Object attributeValue = getAttributeValueFromObject(clone); if (!isMutable()) { setAttributeValueInObject(backup, attributeValue); return; } Object clonedAttributeValue; // If the mapping is read-only, a direct pass through of the value will be performed. // This is done because the method invocation is not possible as the row will be // empty and we have no way to clone the value. // Since the value cannot change anyway we just pass it through. if (isReadOnly()) { clonedAttributeValue = attributeValue; } else { clonedAttributeValue = getIndirectionPolicy().backupCloneAttribute(attributeValue, clone, backup, unitOfWork); } setAttributeValueInObject(backup, clonedAttributeValue); }
/** * INTERNAL: * Copy of the attribute of the object. * This is NOT used for unit of work but for templatizing an object. */ public void buildCopy(Object copy, Object original, ObjectCopyingPolicy policy) { // If mapping is a no-attribute transformation mapping, do nothing if (isWriteOnly()) { return; } Object attributeValue = getAttributeValueFromObject(original); Object clonedAttributeValue; // If the mapping is read-only, a direct pass through of the value will be performed. // This is done because the method invocation is not possible as the row will be // empty and we have no way to clone the value. // Since the value cannot change anyway we just pass it through. if (isReadOnly() || !isMutable()) { clonedAttributeValue = attributeValue; } else { AbstractRecord row = this.buildPhantomRowFrom(original, policy.getSession()); clonedAttributeValue = invokeAttributeTransformer(row, copy, policy.getSession()); } setAttributeValueInObject(copy, clonedAttributeValue); }