/** * Post construct. */ protected void postConstruct() { DynamicPropertiesManager dpm = fetchPropertiesManager(); dpm.postConstruct(this); }
/** * After entity is created, initialize all required attributes. * @param type * @param entity */ public void initializeProperties(DynamicTypeImpl type, DynamicEntityImpl entity) { if (type != null) { for (DatabaseMapping mapping : type.getMappingsRequiringInitialization()) { initializeDefaultValue(mapping, entity); } } }
protected void initializeSlotValues(DynamicEntityImpl entity) { getInitializatonPolicy().initializeProperties((DynamicTypeImpl)type, entity); }
public boolean isSet(String propertyName) { return isSet(getType().getMapping(propertyName)); }
@Override public String toString() { return "DynamicEntityType(" + getName() + ") - " + getDescriptor(); } }
protected void createSlots(DynamicEntityImpl entity) { Map<String, PropertyWrapper> propertiesMap = entity.getPropertiesMap(); List<String> propertyNames = getPropertyNames(); if (propertyNames != null) { for (String propertyName : propertyNames) { propertiesMap.put(propertyName, new PropertyWrapper()); } } }
public Object getAttributeValueFromObject(Object entity) throws DescriptorException { Map<String, PropertyWrapper> propertiesMap = ((DynamicEntityImpl)entity).getPropertiesMap(); PropertyWrapper wrapper = propertiesMap.get(attributeName); // wrapper is never null return wrapper.getValue(); }
public void postConstruct(DynamicEntity entity) { // first step, create 'slots' in propertiesMap createSlots((DynamicEntityImpl)entity); // next step, initialize 'slot' values initializeSlotValues((DynamicEntityImpl)entity); }
/** * Provide access to the entity's type. * * @param entity * @return * @throws ClassCastException * if entity is not an instance of {@link DynamicEntityImpl} */ public static DynamicType getType(DynamicEntity entity) throws ClassCastException { return ((DynamicEntityImpl) entity).getType(); }
/** * Instantiates a new property wrapper. * * @param value the value */ public PropertyWrapper(Object value) { setValue(value); }
/** * <b>INTERNAL</b>: Direct access to the value in the Object[] for this * mapping. This method is provided for advanced users and BYPASSES THE USE * OF NULL_VALUE. All application access should be done using the * {@link DynamicEntity} API */ public void setRawValue(Object entity, Object value) { getValues(entity)[getIndex()] = value; }
/** * Instantiates a new unknown mapping. * * @param propertyName the property name */ public UnknownMapping(String propertyName) { setAttributeName(propertyName); }
/** * Return the default (zero-argument) constructor for the descriptor class. */ protected Constructor<?> getTypeConstructor() throws DescriptorException { if (this.constructor == null) { initialize(null); } return this.constructor; }
protected void createSlots(DynamicEntityImpl entity) { Map<String, PropertyWrapper> propertiesMap = entity.getPropertiesMap(); List<String> propertyNames = getPropertyNames(); if (propertyNames != null) { for (String propertyName : propertyNames) { propertiesMap.put(propertyName, new PropertyWrapper()); } } }
/** * Post construct. */ protected void postConstruct() { DynamicPropertiesManager dpm = fetchPropertiesManager(); dpm.postConstruct(this); }
/** * After entity is created, initialize all required attributes. * @param type * @param entity */ public void initializeProperties(DynamicTypeImpl type, DynamicEntityImpl entity) { if (type != null) { for (DatabaseMapping mapping : type.getMappingsRequiringInitialization()) { initializeDefaultValue(mapping, entity); } } }
protected void initializeSlotValues(DynamicEntityImpl entity) { getInitializatonPolicy().initializeProperties((DynamicTypeImpl)type, entity); }
public void postConstruct(DynamicEntity entity) { // first step, create 'slots' in propertiesMap createSlots((DynamicEntityImpl)entity); // next step, initialize 'slot' values initializeSlotValues((DynamicEntityImpl)entity); }
/** * Provide access to the entity's type. * * @param entity * @return * @throws ClassCastException * if entity is not an instance of {@link DynamicEntityImpl} */ public static DynamicType getType(DynamicEntity entity) throws ClassCastException { return ((DynamicEntityImpl) entity).getType(); }