Key annotations
These are the annotations that define most of the Mateu DSL.
This page is intentionally selective: it focuses on the annotations that shape routing, UI structure, actions, relationships, behavior, security, and presentation.
Defines a UI root.
@UI("/products")public class Products {}Use it when a class should become a page or UI entry point.
Key fields
Section titled “Key fields”value()→ route or UI pathindexHtmlPath()→ frontend entry htmlfrontendComponentPath()→ renderer entry path
@Route
Section titled “@Route”Defines additional routes and supports placeholders.
@Route("/example/:name")public class ExamplePage { String name;}Use it when:
- you need path parameters
- you want more than one route
- you want nested routing with
parentRoute
Key fields
Section titled “Key fields”value()→ route patternuis()→ UI roots where the route appliesparentRoute()→ parent route for composition
Adds a field to the application menu.
@MenuUsers users;Use it to expose pages, modules or links in app navigation.
Key fields
Section titled “Key fields”selected()→ mark current option as selected
@Button
Section titled “@Button”Marks a field or method as a button/action.
@Buttonvoid save() {}Use it for form-level actions.
Targets:
- methods
- fields
@Toolbar
Section titled “@Toolbar”Places a field or method in the toolbar.
@Toolbarvoid refresh() {}Use it for top-level actions, typically in headers or listings.
@Action
Section titled “@Action”Configures action behavior.
@Action( validationRequired = true, confirmationRequired = true)Use it when you need more than a bare button.
What it controls
Section titled “What it controls”- validation
- confirmation dialogs
- background execution
- SSE
- browser integration (
href,js) - modal settings
- selected-row requirement
- fields to validate
@Lookup
Section titled “@Lookup”Defines a relationship resolved dynamically by backend suppliers.
@Lookup( search = PermissionOptionsSupplier.class, label = PermissionLabelSupplier.class)List<String> permissions;Use it when a field depends on remote or dynamic options.
Key fields
Section titled “Key fields”search()→LookupOptionsSupplierlabel()→LabelSupplier
@Stereotype
Section titled “@Stereotype”Overrides the default inferred rendering type of a field.
@Stereotype(FieldStereotype.radio)Status status;Use it when the Java type is not enough to express how the field should be rendered.
@Style
Section titled “@Style”Adds inline CSS style to a type, field or parameter.
@Style("max-width:900px;margin:auto;")Use it for layout constraints and small visual adjustments.
@FormLayout
Section titled “@FormLayout”Controls form rendering.
@FormLayout(columns = 1)public class MixedPage {}Use it when you want to change the default form layout.
Key fields
Section titled “Key fields”columns()theme()style()
Defines dynamic browser-side behavior.
@Rule( filter = "name == null || name == ''", action = RuleAction.Set, fieldName = "save", fieldAttribute = RuleFieldAttribute.disabled, value = "true", expression = "", actionId = "", result = RuleResult.Value)Use it when the UI must change dynamically without a server round-trip.
What it can affect
Section titled “What it can affect”- field attributes
- values
- styles
- css classes
- actions
@Trigger
Section titled “@Trigger”Defines when an action runs.
@Trigger(type = TriggerType.OnLoad, actionId = "refresh")Use it when an action should be triggered automatically.
Trigger types
Section titled “Trigger types”OnLoadOnSuccessOnErrorOnValueChangeOnCustomEventOnEnter
@EyesOnly
Section titled “@EyesOnly”Restricts access to parts of the UI.
@EyesOnly(roles = "admin")@MenuUsers users;Use it for authorization.
Supported scopes
Section titled “Supported scopes”- roles
- groups
- scopes
- permissions
@KeycloakSecured
Section titled “@KeycloakSecured”Secures a UI using Keycloak.
@UI("")@KeycloakSecured( url = "https://auth-server", realm = "mateu", clientId = "demo")public class App {}Use it for application authentication.
Key fields
Section titled “Key fields”url()realm()clientId()jsUrl()
Other useful annotations
Section titled “Other useful annotations”These are also part of the public DSL and are worth knowing:
@PageTitle@Title@Subtitle@Logo@FavIcon@Widget@Footer@Header@Section@Colspan@ReadOnly@HiddenInList@HiddenInView@HiddenInEditor@HiddenInCreate@EditableOnlyWhenCreating@Status@Representation@Details@VerticalLayout@HorizontalLayout@SplitLayout@Accordion@Tabs
Mental model
Section titled “Mental model”The Mateu DSL is annotation-heavy by design.
Annotations define:
- routing
- structure
- behavior
- relationships
- rendering
- security
The result is a declarative application model instead of a separate frontend implementation.