Package io.jmix.dynmodel.impl
Class DynamicCalculatedAttributeEvaluatorRegistry
java.lang.Object
io.jmix.dynmodel.impl.DynamicCalculatedAttributeEvaluatorRegistry
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
@Component("dynmod_DynamicCalculatedAttributeEvaluatorRegistry")
public class DynamicCalculatedAttributeEvaluatorRegistry
extends Object
implements org.springframework.beans.factory.InitializingBean
Maintains calculated-attribute evaluators registered in the application context.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<DynamicCalculatedAttributeEvaluator> protected final Map<String, DynamicCalculatedAttributeEvaluator> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidIndexes evaluator beans by name and rejects duplicate names.@Nullable DynamicCalculatedAttributeEvaluatorfindEvaluator(String evaluatorName) Finds an evaluator by name without throwing if it is absent.getEvaluator(DynamicAttributeDefinition attributeDef, String entityName, String defaultEvaluator) Resolves and returns the evaluator for a calculated dynamic attribute definition.resolveEvaluatorName(@Nullable String declaredEvaluator, String defaultEvaluator) Resolves evaluator name according to the calculated-attribute precedence rules.
-
Field Details
-
evaluators
-
evaluatorsByName
-
-
Constructor Details
-
DynamicCalculatedAttributeEvaluatorRegistry
public DynamicCalculatedAttributeEvaluatorRegistry()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()Indexes evaluator beans by name and rejects duplicate names.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getEvaluator
public DynamicCalculatedAttributeEvaluator getEvaluator(DynamicAttributeDefinition attributeDef, String entityName, String defaultEvaluator) Resolves and returns the evaluator for a calculated dynamic attribute definition.- Parameters:
attributeDef- dynamic attribute definition with calculated settingsentityName- owner entity name used in validation messagesdefaultEvaluator- application default evaluator name- Returns:
- matching evaluator
-
findEvaluator
Finds an evaluator by name without throwing if it is absent.- Parameters:
evaluatorName- evaluator name- Returns:
- evaluator bean, or
null
-
resolveEvaluatorName
Resolves evaluator name according to the calculated-attribute precedence rules.- Parameters:
declaredEvaluator- evaluator declared on an attributedefaultEvaluator- application default evaluator- Returns:
- effective evaluator name
-