/** * Return a new instance of the receiver's javaClass. */ public Object buildNewInstance() { return this.descriptor.getInstantiationPolicy().buildNewInstance(); }
/** * Return a new instance of the receiver's javaClass. */ public Object buildNewInstance() { return this.descriptor.getInstantiationPolicy().buildNewInstance(); }
/** * Return a new instance of the receiver's javaClass. */ public Object buildNewInstance() { return this.descriptor.getInstantiationPolicy().buildNewInstance(); }
public JAXBValueStore(JAXBHelperContext aJAXBHelperContext, SDOType sdoType) { this.jaxbHelperContext = aJAXBHelperContext; this.listWrappers = new WeakHashMap<Property, JAXBListWrapper>(); this.descriptor = jaxbHelperContext.getObjectDescriptor(sdoType); this.entity = this.descriptor.getInstantiationPolicy().buildNewInstance(); }
public JAXBValueStore(JAXBHelperContext aJAXBHelperContext, SDOType sdoType) { this.jaxbHelperContext = aJAXBHelperContext; this.listWrappers = new WeakHashMap<Property, JAXBListWrapper>(); this.descriptor = jaxbHelperContext.getObjectDescriptor(sdoType); this.entity = this.descriptor.getInstantiationPolicy().buildNewInstance(); }
public DynamicEntity newDynamicEntity() { DynamicEntity newDynamicEntity = (DynamicEntity)getDescriptor().getInstantiationPolicy(). buildNewInstance(); return newDynamicEntity; }
@Override public DynamicEntity newDynamicEntity() { DynamicEntity newDynamicEntity = (DynamicEntity)getDescriptor().getInstantiationPolicy(). buildNewInstance(); return newDynamicEntity; }
public DynamicEntity newDynamicEntity() { return (DynamicEntity) getDescriptor().getInstantiationPolicy().buildNewInstance(); }
private Object wrapEnumeration(Object object, Class enumerationClass) { Class generatedClass = this.getClassToGeneratedClasses().get(enumerationClass.getName()); if (generatedClass != null && WrappedValue.class.isAssignableFrom(generatedClass)) { ClassDescriptor desc = xmlMarshaller.getXMLContext().getSession(generatedClass).getDescriptor(generatedClass); Object newObject = desc.getInstantiationPolicy().buildNewInstance(); ((WrappedValue) newObject).setValue(object); object = newObject; } return object; }
private Object wrapEnumeration(Object object, Class enumerationClass) { Class generatedClass = this.getClassToGeneratedClasses().get(enumerationClass.getName()); if (generatedClass != null && WrappedValue.class.isAssignableFrom(generatedClass)) { ClassDescriptor desc = xmlMarshaller.getXMLContext().getSession(generatedClass).getDescriptor(generatedClass); Object newObject = desc.getInstantiationPolicy().buildNewInstance(); ((WrappedValue) newObject).setValue(object); object = newObject; } return object; }
/** * INTERNAL: * Create an instance of the Key object from the key information extracted from the map. * This key object may be a shallow stub of the actual object if the key is an Entity type. */ public Object createStubbedMapComponentFromSerializableKeyInfo(Object keyInfo, AbstractSession session) { ObjectBuilder builder = this.referenceDescriptor.getObjectBuilder(); ObjectBuildingQuery clonedQuery = (ObjectBuildingQuery) getSelectionQuery().clone(); clonedQuery.setSession(session); Object newObject = referenceDescriptor.getInstantiationPolicy().buildNewInstance(); builder.buildPrimaryKeyAttributesIntoObject(newObject, builder.buildRowFromPrimaryKeyValues(keyInfo, session), clonedQuery, session); return newObject; }
return d.getInstantiationPolicy().buildNewInstance();
return d.getInstantiationPolicy().buildNewInstance();
/** * INTERNAL: * Create an instance of the Key object from the key information extracted from the map. * This key object may be a shallow stub of the actual object if the key is an Entity type. */ public Object createStubbedMapComponentFromSerializableKeyInfo(Object keyInfo, AbstractSession session) { ObjectBuilder builder = this.referenceDescriptor.getObjectBuilder(); ObjectBuildingQuery clonedQuery = (ObjectBuildingQuery) getSelectionQuery().clone(); clonedQuery.setSession(session); Object newObject = referenceDescriptor.getInstantiationPolicy().buildNewInstance(); builder.buildPrimaryKeyAttributesIntoObject(newObject, builder.buildRowFromPrimaryKeyValues(keyInfo, session), clonedQuery, session); return newObject; }
Object newObject = desc.getInstantiationPolicy().buildNewInstance(); ((WrappedValue) newObject).setValue(object); object = newObject; Object newObject = desc.getInstantiationPolicy().buildNewInstance(); ((ManyValue) newObject).setItem(object); object = newObject;
/** * INTERNAL: * Either create a new change record or update the change record with the new value. * This is used by attribute change tracking. */ @Override public void updateChangeRecord(Object clone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) { TransformationMappingChangeRecord changeRecord = (TransformationMappingChangeRecord)objectChangeSet.getChangesForAttributeNamed(this.getAttributeName()); Object updatedObject = descriptor.getInstantiationPolicy().buildNewInstance(); this.setAttributeValueInObject(updatedObject, newValue); if (!isWriteOnly()) { if (changeRecord == null) { objectChangeSet.addChange(internalBuildChangeRecord(updatedObject, oldValue, objectChangeSet, uow)); } else { changeRecord.setRow(this.buildPhantomRowFrom(updatedObject, uow)); } } }
/** * INTERNAL: * Either create a new change record or update the change record with the new value. * This is used by attribute change tracking. */ @Override public void updateChangeRecord(Object clone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) { TransformationMappingChangeRecord changeRecord = (TransformationMappingChangeRecord)objectChangeSet.getChangesForAttributeNamed(this.getAttributeName()); Object updatedObject = descriptor.getInstantiationPolicy().buildNewInstance(); this.setAttributeValueInObject(updatedObject, newValue); if (!isWriteOnly()) { if (changeRecord == null) { objectChangeSet.addChange(internalBuildChangeRecord(updatedObject, oldValue, objectChangeSet, uow)); } else { changeRecord.setRow(this.buildPhantomRowFrom(updatedObject, uow)); } } }
/** * INTERNAL: * Validate that the descriptor was defined correctly. * This allows for checks to be done that require the descriptor initialization to be completed. */ protected void selfValidationAfterInitialization(AbstractSession session) throws DescriptorException { // This has to be done after, because read subclasses must be initialized. if ( (hasInheritance() && (getInheritancePolicy().shouldReadSubclasses() || isAbstract())) || hasTablePerClassPolicy() && isAbstract() ) { // Avoid building a new instance if the inheritance class is abstract. // There is an empty statement here, and this was done if anything for the // readability sake of the statement logic. } else if (session.getIntegrityChecker().shouldCheckInstantiationPolicy()) { getInstantiationPolicy().buildNewInstance(); } if (hasReturningPolicy()) { getReturningPolicy().validationAfterDescriptorInitialization(session); } getObjectBuilder().validate(session); }
/** * INTERNAL: * Validate that the descriptor was defined correctly. * This allows for checks to be done that require the descriptor initialization to be completed. */ protected void selfValidationAfterInitialization(AbstractSession session) throws DescriptorException { // This has to be done after, because read subclasses must be initialized. if ( (hasInheritance() && (getInheritancePolicy().shouldReadSubclasses() || isAbstract())) || hasTablePerClassPolicy() && isAbstract() ) { // Avoid building a new instance if the inheritance class is abstract. // There is an empty statement here, and this was done if anything for the // readability sake of the statement logic. } else if (session.getIntegrityChecker().shouldCheckInstantiationPolicy()) { getInstantiationPolicy().buildNewInstance(); } if (hasReturningPolicy()) { getReturningPolicy().validationAfterDescriptorInitialization(session); } getObjectBuilder().validate(session); }
/** * INTERNAL: * Validate that the descriptor was defined correctly. * This allows for checks to be done that require the descriptor initialization to be completed. */ protected void selfValidationAfterInitialization(AbstractSession session) throws DescriptorException { // This has to be done after, because read subclasses must be initialized. if ( (hasInheritance() && (getInheritancePolicy().shouldReadSubclasses() || isAbstract())) || hasTablePerClassPolicy() && isAbstract() ) { // Avoid building a new instance if the inheritance class is abstract. // There is an empty statement here, and this was done if anything for the // readability sake of the statement logic. } else if (session.getIntegrityChecker().shouldCheckInstantiationPolicy()) { getInstantiationPolicy().buildNewInstance(); } if (hasReturningPolicy()) { getReturningPolicy().validationAfterDescriptorInitialization(session); } getObjectBuilder().validate(session); }