Class DynamicViewApiIntrospector
java.lang.Object
io.jmix.dynmodelflowui.impl.behavior.DynamicViewApiIntrospector
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
@Component("dynmod_DynamicViewApiIntrospector")
public class DynamicViewApiIntrospector
extends Object
implements org.springframework.beans.factory.InitializingBean
Describes the sandbox API available to dynamic view behavior handler expressions, so the Admin UI
handler editor can offer it as code completion.
The description is derived by reflection from DynamicViewHandlerContext rather than written
by hand, so a facade method added later appears in the editor without a change here. The rules
match what the sandbox accepts at runtime: only public non-static methods of
DynamicViewApi-annotated classes, never a method declared by Object (see
FacadeMethodResolver).
A public no-argument getXxx() is reported as the property xxx; every other method is
reported as a method. isNew() is therefore a method, matching the documented call form, and
does not turn into a new property.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA single member of the sandbox API. -
Field Summary
FieldsModifier and TypeFieldDescriptionFor each facade type, the property name of every nested facade and its type.protected final Map<Class<?>, List<DynamicViewApiIntrospector.ApiMember>> Members by declaring facade type, including the root context type. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidDescribes the given facade type and, recursively, every facade it exposes.getMembers(String receiverPath) Returns the members of the facade the given path resolves to.Returns the members available at the start of an expression: the entity,isNew(), and the facades.protected booleanisApiMethod(Method method) protected StringmethodDisplayText(Method method) BuildssetVisible(componentId, visible).protected @Nullable StringpropertyName(Method method) Returns the property name of a no-argumentgetXxx()getter, ornullwhen the method is not such a getter.protected @Nullable Class<?> resolveType(String receiverPath) protected @Nullable String
-
Field Details
-
membersByType
Members by declaring facade type, including the root context type. -
facadesByType
For each facade type, the property name of every nested facade and its type.
-
-
Constructor Details
-
DynamicViewApiIntrospector
public DynamicViewApiIntrospector()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getRootMembers
Returns the members available at the start of an expression: the entity,isNew(), and the facades. -
getMembers
Returns the members of the facade the given path resolves to.- Parameters:
receiverPath- a dotted path from the expression root, for examplecomponentsorevent- Returns:
- the members of the resolved facade, or an empty list when the path leaves the facades —
an unknown name, or a value the sandbox exposes as a plain object such as
entity
-
resolveType
-
describe
Describes the given facade type and, recursively, every facade it exposes. The type is registered before its members are collected, so a facade cycle cannot cause endless recursion. -
isApiMethod
-
propertyName
Returns the property name of a no-argumentgetXxx()getter, ornullwhen the method is not such a getter.isXxx()is deliberately not treated as a getter: the sandbox documentsisNew()as a call. -
methodDisplayText
BuildssetVisible(componentId, visible). Parameter names come from reflection — all Jmix modules are compiled with-parameters— and a class compiled without them falls back to parameter types. -
typeName
-