Package io.micronaut.views.fields.render
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
Modifier and TypeFieldDescriptionstatic final String
HTML Attribute checked.static final String
HTML Attribute cols.static final String
HTML Attribute disabled.static final String
HTML Attribute for.static final String
HTML Attribute id.static final String
HTML Attribute max.static final String
HTML Attribute maxlength.static final String
HTML Attribute min.static final String
HTML Attribute minlength.static final String
HTML Attribute name.static final String
HTML Attribute pattern.static final String
HTML Attribute placeholder.static final String
HTML Attribute readonly.static final String
HTML Attribute required.static final String
HTML Attribute rows.static final String
HTML Attribute selected.static final String
HTML Attribute size.static final String
HTML Attribute step.static final String
HTML Attribute type.static final String
HTML Attribute value.static final String
Greater than sign.static final String
Lower than sign.static final String
Slash.static final String
Space. -
Method Summary
Modifier and TypeMethodDescriptiondefault @NonNull List<HtmlAttribute>
attributes
(@NonNull InputStringFormElement el, @NonNull InputType type) default String
content
(@NonNull Message message, @NonNull io.micronaut.context.MessageSource messageSource, @NonNull Locale locale) default @NonNull String
render
(@NonNull HtmlTag tag, @NonNull List<HtmlAttribute> attributes) Renders an HTML Tag.default @NonNull String
render
(@NonNull HtmlTag tag, @NonNull List<HtmlAttribute> attributes, @NonNull String content) Renders an HTML Tag.@NonNull String
Renders a Form Element as HTML.default String
renderCloseTag
(@NonNull HtmlTag tag) default String
renderLabel
(@Nullable String id, @NonNull Message message, @NonNull io.micronaut.context.MessageSource messageSource, @NonNull Locale locale) default String
renderOpenTag
(@NonNull HtmlTag tag, @NonNull List<HtmlAttribute> attributes) default HtmlAttribute
typeHtmlAttribute
(@NonNull InputType type)
-
Field Details
-
ATTR_FOR
HTML Attribute for.- See Also:
-
ATTR_VALUE
HTML Attribute value.- See Also:
-
ATTR_SELECTED
HTML Attribute selected.- See Also:
-
ATTR_DISABLED
HTML Attribute disabled.- See Also:
-
ATTR_ID
HTML Attribute id.- See Also:
-
ATTR_ROWS
HTML Attribute rows.- See Also:
-
ATTR_COLS
HTML Attribute cols.- See Also:
-
ATTR_PLACEHOLDER
HTML Attribute placeholder.- See Also:
-
ATTR_STEP
HTML Attribute step.- See Also:
-
ATTR_REQUIRED
HTML Attribute required.- See Also:
-
ATTR_READ_ONLY
HTML Attribute readonly.- See Also:
-
ATTR_MAX_LENGTH
HTML Attribute maxlength.- See Also:
-
ATTR_MIN_LENGTH
HTML Attribute minlength.- See Also:
-
ATTR_MAX
HTML Attribute max.- See Also:
-
ATTR_MIN
HTML Attribute min.- See Also:
-
ATTR_PATTERN
HTML Attribute pattern.- See Also:
-
ATTR_SIZE
HTML Attribute size.- See Also:
-
ATTR_NAME
HTML Attribute name.- See Also:
-
ATTR_CHECKED
HTML Attribute checked.- See Also:
-
ATTR_TYPE
HTML Attribute type.- See Also:
-
LESS_THAN
Lower than sign.- See Also:
-
GREATER_THAN
Greater than sign.- See Also:
-
SLASH
Slash.- See Also:
-
SPACE
Space.- See Also:
-
-
Method Details
-
render
Renders a Form Element as HTML.- Parameters:
formElement
- Form Elementlocale
- Locale- Returns:
- HTML
-
render
@NonNull default @NonNull String render(@NonNull @NonNull HtmlTag tag, @NonNull @NonNull List<HtmlAttribute> attributes) Renders an HTML Tag.- Parameters:
tag
- HTML Tagattributes
- HTML attributes- Returns:
- HTML
-
render
@NonNull default @NonNull String render(@NonNull @NonNull HtmlTag tag, @NonNull @NonNull List<HtmlAttribute> attributes, @NonNull @NonNull String content) Renders an HTML Tag.- Parameters:
tag
- HTML Tagattributes
- HTML attributescontent
- Content- Returns:
- HTML
-
renderLabel
default String renderLabel(@Nullable @Nullable String id, @NonNull @NonNull Message message, @NonNull @NonNull io.micronaut.context.MessageSource messageSource, @NonNull @NonNull Locale locale) - Parameters:
id
- element id referenced by the labelmessage
- MessagemessageSource
- Message Sourcelocale
- Locale- Returns:
- localized content
-
renderOpenTag
default String renderOpenTag(@NonNull @NonNull HtmlTag tag, @NonNull @NonNull List<HtmlAttribute> attributes) - Parameters:
tag
- an HTML Tagattributes
- HTML Attributes- Returns:
- HTML
-
renderCloseTag
- Parameters:
tag
- an HTML Tag- Returns:
- HTML
-
content
default String content(@NonNull @NonNull Message message, @NonNull @NonNull io.micronaut.context.MessageSource messageSource, @NonNull @NonNull Locale locale) - Parameters:
message
- MessagemessageSource
- Message Sourcelocale
- Locale- Returns:
- localized content
-
typeHtmlAttribute
- Parameters:
type
- Input type- Returns:
- An HTML attribute with key type and value the parameter
-
attributes
@NonNull default @NonNull List<HtmlAttribute> attributes(@NonNull @NonNull InputStringFormElement el, @NonNull @NonNull InputType type) - Parameters:
el
- InputStringFormElementtype
- input type- Returns:
- HTML Attributes
-