Package io.jmix.dynmodel.impl
Class DynamicEntityState
java.lang.Object
io.jmix.dynmodel.impl.DynamicEntityState
- All Implemented Interfaces:
EntityEntryExtraState,EntityValuesProvider,Serializable
public class DynamicEntityState
extends Object
implements EntityEntryExtraState, EntityValuesProvider
Entity extra state that provides dynamic attribute values, including calculated attribute evaluation.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.beans.factory.BeanFactoryprotected DynamicValuesprotected final EntityEntry -
Constructor Summary
ConstructorsConstructorDescriptionDynamicEntityState(EntityEntry entityEntry) Invoked by reflection inio.jmix.core.entity.BaseEntityEntry#copy(io.jmix.core.EntityEntry)DynamicEntityState(EntityEntry entityEntry, Set<String> dynamicPropertyNames, org.springframework.beans.factory.BeanFactory beanFactory) Creates dynamic entity state with calculated-attribute support. -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy(EntityEntryExtraState extraState) Copies supported property names, calculated support services, and stored dynamic values from another state.Returns stored dynamic attribute names.<T> @Nullable TgetAttributeValue(String name) Returns a stored dynamic attribute value or evaluates a calculated dynamic attribute.protected DynamicCalculatedAttributeSupportReturns changes collected for stored dynamic attributes.protected DynamicModelTools@Nullable DynamicValuesReturns the entity entry that owns this state.protected Metadataprotected MetaPropertygetMetaProperty(String name) protected MetaClassprotected booleanisCalculatedAttribute(String name) protected voidputTransformed(Set<AttributeChanges.Change> output, Map<String, Object> source) voidsetAttributeValue(String name, @Nullable Object value, boolean checkEquals) Updates a stored dynamic attribute or rejects writes to calculated dynamic attributes.voidsetDynamicValues(DynamicValues dynamicValues) Sets loaded dynamic values for stored dynamic attributes.booleansupportAttribute(String name) Returns whether this state provides a value for the given attribute.
-
Field Details
-
entityEntry
-
dynamicPropertyNames
-
dynamicValues
-
beanFactory
protected transient org.springframework.beans.factory.BeanFactory beanFactory
-
-
Constructor Details
-
DynamicEntityState
public DynamicEntityState(EntityEntry entityEntry, Set<String> dynamicPropertyNames, org.springframework.beans.factory.BeanFactory beanFactory) Creates dynamic entity state with calculated-attribute support.- Parameters:
entityEntry- entity entrydynamicPropertyNames- supported dynamic property namesbeanFactory- bean factory
-
DynamicEntityState
Invoked by reflection inio.jmix.core.entity.BaseEntityEntry#copy(io.jmix.core.EntityEntry)- Parameters:
entityEntry- copied entity entry
-
-
Method Details
-
getDynamicValues
-
setDynamicValues
Sets loaded dynamic values for stored dynamic attributes.- Parameters:
dynamicValues- dynamic values
-
supportAttribute
Returns whether this state provides a value for the given attribute.- Specified by:
supportAttributein interfaceEntityValuesProvider- Parameters:
name- attribute name- Returns:
trueif the attribute is dynamic and supported by this state
-
getAttributeValue
Returns a stored dynamic attribute value or evaluates a calculated dynamic attribute.- Specified by:
getAttributeValuein interfaceEntityValuesProvider- Parameters:
name- attribute name- Returns:
- attribute value
-
setAttributeValue
Updates a stored dynamic attribute or rejects writes to calculated dynamic attributes.- Specified by:
setAttributeValuein interfaceEntityValuesProvider- Parameters:
name- attribute namevalue- new valuecheckEquals- whether equal values should suppress change events
-
getEntityEntry
Returns the entity entry that owns this state.- Specified by:
getEntityEntryin interfaceEntityEntryExtraState- Returns:
- entity entry
-
copy
Copies supported property names, calculated support services, and stored dynamic values from another state.- Specified by:
copyin interfaceEntityEntryExtraState- Parameters:
extraState- source extra state
-
getAttributes
Returns stored dynamic attribute names.- Specified by:
getAttributesin interfaceEntityValuesProvider- Returns:
- stored dynamic attribute names
-
getChanges
Returns changes collected for stored dynamic attributes.- Specified by:
getChangesin interfaceEntityValuesProvider- Returns:
- dynamic attribute changes
-
putTransformed
-
isCalculatedAttribute
-
getMetaProperty
-
getMetaPropertyMetaClass
-
getMetadata
-
getCalculatedAttributeSupport
-
getDynamicModelTools
-