Class ViewComponentTagCapabilities
The answer is derived from the same interfaces DynamicViewBehaviorManager tests at runtime:
ClickNotifier for click, and SupportsTypedValue or HasValue for
valueChange. The component class behind a tag is resolved through
LoaderResolver, which honors application-registered custom tags and overrides of built-in
ones, and then read from the loader's ComponentLoader type argument — no component is
instantiated.
A tag whose component class cannot be pinned down serves neither trigger: when the tag has no loader of its own, or the loader's type argument is missing or as unspecific as the base component type, nothing supports offering it, and such an element is unlikely to be a usable target. It is left out of the dropdown; the editor's combo still accepts a typed value, so it stays reachable by hand.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhat a tag can be used for. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String, ViewComponentTagCapabilities.Capabilities> The component registry is populated once on context refresh and does not change afterwards, so a resolved tag stays valid for the lifetime of the application.protected LoaderResolverprotected static final ViewComponentTagCapabilities.CapabilitiesReported for a tag whose component class cannot be pinned down: offered for neither trigger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns what the given view XML tag can be used for.protected @Nullable Class<?> Resolves the component class declared by the loader registered for the tag, ornullwhen the tag has no loader or the loader does not name a component type.
-
Field Details
-
UNRESOLVED
Reported for a tag whose component class cannot be pinned down: offered for neither trigger. -
loaderResolver
-
cache
The component registry is populated once on context refresh and does not change afterwards, so a resolved tag stays valid for the lifetime of the application.
-
-
Constructor Details
-
ViewComponentTagCapabilities
public ViewComponentTagCapabilities()
-
-
Method Details
-
get
Returns what the given view XML tag can be used for. Never throws.- Parameters:
tag- view XML element name, such asbuttonortextField
-
resolve
-
resolveComponentClass
Resolves the component class declared by the loader registered for the tag, ornullwhen the tag has no loader or the loader does not name a component type.
-