Package io.jmix.dynmodelflowui.impl
Class DynamicViewEntityAttributeProvider
java.lang.Object
io.jmix.dynmodelflowui.impl.DynamicViewEntityAttributeProvider
@Component("dynmod_DynamicViewEntityAttributeProvider")
public class DynamicViewEntityAttributeProvider
extends Object
Lists the attributes reachable through
entity in a behavior handler expression, so the Admin
UI can offer them as code completion.
Two sources are combined. Current metadata is authoritative and allows nested paths, since it holds
the entity as applied — including its already applied dynamic attributes. The attributes declared in
the edited model are added at the first level, so an attribute added in this editing session is
offered before the model is applied. A dynamic entity that has never been applied has no
MetaClass, so only its declared attributes are offered, and only at the first level.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable StringdeclaredTypeName(DynamicAttributeModel attribute) The type of an attribute that only exists in the edited model.protected @Nullable StringfirstNotBlank(@Nullable String... values) getAttributes(@Nullable DynamicEntityModel entity, List<String> path) Returns the attributes available at the given path, distinct by name and sorted case-insensitively.protected @Nullable MetaClassresolvePath(MetaClass metaClass, List<String> path) Walks the path from the given class through reference attributes.protected @Nullable StringsimpleName(@Nullable String className)
-
Field Details
-
metadata
-
-
Constructor Details
-
DynamicViewEntityAttributeProvider
public DynamicViewEntityAttributeProvider()
-
-
Method Details
-
getAttributes
public List<DynamicViewEntityAttributeProvider.AttributeInfo> getAttributes(@Nullable DynamicEntityModel entity, List<String> path) Returns the attributes available at the given path, distinct by name and sorted case-insensitively. Never throws: an entity or a path that cannot be resolved yields an empty list.- Parameters:
entity- the entity that owns the edited view,nullwhen unknownpath- the reference attributes traversed afterentity, empty forentity.
-
resolvePath
Walks the path from the given class through reference attributes.- Returns:
- the class the path ends at, or
nullwhen a segment is unknown or is not a reference
-
declaredTypeName
The type of an attribute that only exists in the edited model. A reference reports the entity it points to and an enum attribute its enumeration, since neither has a Java class yet. -
simpleName
-
firstNotBlank
-