Interface FormElementRenderer<T extends FormElement>
- Type Parameters:
T- Form element
- All Known Implementing Classes:
InputCheckboxFormElementRenderer, InputCheckboxViewsFormElementRenderer, InputDateFormElementRenderer, InputDateTimeLocalFormElementRenderer, InputDateTimeLocalViewsFormElementRenderer, InputDateViewsFormElementRenderer, InputEmailFormElementRenderer, InputEmailViewsFormElementRenderer, InputHiddenFormElementRenderer, InputHiddenViewsFormElementRenderer, InputNumberFormElementRenderer, InputNumberViewsFormElementRenderer, InputPasswordFormElementRenderer, InputPasswordViewsFormElementRenderer, InputRadioFormElementRenderer, InputRadioViewsFormElementRenderer, InputSubmitFormElementRenderer, InputSubmitViewsFormElementRenderer, InputTelFormElementRenderer, InputTelViewsFormElementRenderer, InputTextFormElementRenderer, InputTextViewsFormElementRenderer, InputTimeFormElementRenderer, InputTimeViewsFormElementRenderer, InputUrlFormElementRenderer, InputUrlViewsFormElementRenderer, OptionFormElementRenderer, OptionViewsFormElementRenderer, SelectFormElementRenderer, SelectViewsFormElementRenderer, TextareaFormElementRenderer, TextareaViewsFormElementRenderer, TrixEditorFormElementRenderer, TrixEditorViewsFormElementRenderer, ViewsFormElementRenderer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
API to render a
FormElement.- Since:
- 4.1.0
- Author:
- Sergio del Amo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringHTML Attribute checked.static final StringHTML Attribute cols.static final StringHTML Attribute disabled.static final StringHTML Attribute for.static final StringHTML Attribute id.static final StringHTML Attribute max.static final StringHTML Attribute maxlength.static final StringHTML Attribute min.static final StringHTML Attribute minlength.static final StringHTML Attribute name.static final StringHTML Attribute pattern.static final StringHTML Attribute placeholder.static final StringHTML Attribute readonly.static final StringHTML Attribute required.static final StringHTML Attribute rows.static final StringHTML Attribute selected.static final StringHTML Attribute size.static final StringHTML Attribute step.static final StringHTML Attribute type.static final StringHTML Attribute value.static final StringGreater than sign.static final StringLower than sign.static final StringSlash.static final StringSpace. -
Method Summary
Modifier and TypeMethodDescriptiondefault @NonNull List<HtmlAttribute> attributes(@NonNull InputStringFormElement el, @NonNull InputType type) default Stringcontent(@NonNull Message message, @NonNull io.micronaut.context.MessageSource messageSource, @NonNull Locale locale) @NonNull StringRenders a Form Element as HTML.default @NonNull Stringrender(@NonNull HtmlTag tag, @NonNull List<HtmlAttribute> attributes) Renders an HTML Tag.default @NonNull Stringrender(@NonNull HtmlTag tag, @NonNull List<HtmlAttribute> attributes, @NonNull String content) Renders an HTML Tag.default StringrenderCloseTag(@NonNull HtmlTag tag) default StringrenderLabel(@Nullable String id, @NonNull Message message, @NonNull io.micronaut.context.MessageSource messageSource, @NonNull Locale locale) default StringrenderOpenTag(@NonNull HtmlTag tag, @NonNull List<HtmlAttribute> attributes) default HtmlAttributetypeHtmlAttribute(@NonNull InputType type)
-
Field Details
-
ATTR_FOR
-
ATTR_VALUE
-
ATTR_SELECTED
-
ATTR_DISABLED
-
ATTR_ID
-
ATTR_ROWS
-
ATTR_COLS
-
ATTR_PLACEHOLDER
-
ATTR_STEP
-
ATTR_REQUIRED
-
ATTR_READ_ONLY
-
ATTR_MAX_LENGTH
-
ATTR_MIN_LENGTH
-
ATTR_MAX
-
ATTR_MIN
-
ATTR_PATTERN
-
ATTR_SIZE
-
ATTR_NAME
-
ATTR_CHECKED
-
ATTR_TYPE
-
LESS_THAN
-
GREATER_THAN
-
SLASH
-
SPACE
-
-
Method Details
-
render
-
render
Renders an HTML Tag.- Parameters:
tag- HTML Tagattributes- HTML attributes- Returns:
- HTML
-
render
default @NonNull String render(@NonNull HtmlTag tag, @NonNull List<HtmlAttribute> attributes, @NonNull String content) Renders an HTML Tag.- Parameters:
tag- HTML Tagattributes- HTML attributescontent- Content- Returns:
- HTML
-
renderLabel
default String renderLabel(@Nullable String id, @NonNull Message message, @NonNull io.micronaut.context.MessageSource messageSource, @NonNull Locale locale) - Parameters:
id- element id referenced by the labelmessage- MessagemessageSource- Message Sourcelocale- Locale- Returns:
- localized content
-
renderOpenTag
- Parameters:
tag- an HTML Tagattributes- HTML Attributes- Returns:
- HTML
-
renderCloseTag
-
content
-
typeHtmlAttribute
- Parameters:
type- Input type- Returns:
- An HTML attribute with key type and value the parameter
-
attributes
default @NonNull List<HtmlAttribute> attributes(@NonNull InputStringFormElement el, @NonNull InputType type) - Parameters:
el- InputStringFormElementtype- input type- Returns:
- HTML Attributes
-