Maslosoft Framework Logo Maslosoft Framework Documentation
Flexible Application Foundation


Field Preset Annotation

This annotation allows you to use preconfigure bundles containing:

  • Renderers for form, grid, view
  • Decorators
  • Validators

The purpose of this annotation is to use reusable presets on similar fields, instead of defining each property's renderers, decorators or validators.

To use field preset annotation, attach it to class property and use preset class as parameter:

@FieldPreset(MyFieldPreset)

Or more real usage example, which is contained in this project:

@FieldPreset(TogglePreset)

The TogglePreset will render checkbox in form, will display Yes or No in grids additionally setting up CSS classes to indicate state also visually.

The field with TogglePreset will be also validated for proper boolean value.