Skip to content

Field Type Annotations

These annotations control how individual fields are rendered and what input widget is used in edit mode.


Target: FIELD

Sets the input widget type for a field. Mateu infers a default stereotype from the Java type (e.g. String → text input, boolean → checkbox), but @Stereotype overrides that inference.

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Stereotype {
FieldStereotype value();
}
AttributeTypeDescription
valueFieldStereotypeThe widget stereotype to apply
ValueDescription
regularDefault text input
radioRadio button group
checkboxCheckbox input
textareaMulti-line text area
toggleToggle switch
comboboxCombo box (typed input with dropdown)
selectDropdown select
emailEmail input
passwordPassword input (masked)
richTextRich text / WYSIWYG editor
listBoxList box (scrollable options)
htmlRaw HTML display
markdownMarkdown editor / renderer
imageImage upload / display
iconIcon picker
linkHyperlink
moneyCurrency amount
gridEmbedded data grid
colorColor picker
choiceChoice selector
popoverPopover trigger
sliderRange slider
buttonButton
starsStar rating

From the Products demo:

@Stereotype(FieldStereotype.textarea)
@HiddenInList
String description;

No attributes. Shorthand for @Stereotype(FieldStereotype.radio). Renders an enum or options field as a radio button group instead of a dropdown.

public @interface UseRadioButtons {}
public class OrderForm {
@UseRadioButtons
DeliveryMethod delivery;
}

Target: FIELD

Sets the minimum value for a slider field. Used together with @Stereotype(FieldStereotype.slider) and @SliderMax.

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface SliderMin {
int value();
}
AttributeTypeDescription
valueintMinimum value of the slider range

Target: FIELD

Sets the maximum value for a slider field. Used together with @Stereotype(FieldStereotype.slider) and @SliderMin.

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface SliderMax {
int value();
}
AttributeTypeDescription
valueintMaximum value of the slider range
@Stereotype(FieldStereotype.slider)
@SliderMin(0)
@SliderMax(100)
int progress;