Class AbstractCheckedElementTag

All Implemented Interfaces:
DynamicAttributes, IterationTag, JspTag, Tag, TryCatchFinally, Serializable, EditorAwareTag
Direct Known Subclasses:
AbstractMultiCheckedElementTag, AbstractSingleCheckedElementTag

public abstract class AbstractCheckedElementTag extends AbstractHtmlInputElementTag
Abstract base class to provide common methods for implementing databinding-aware JSP tags for rendering an HTML 'input' element with a 'type' of 'checkbox' or 'radio'.
Since:
2.5
Author:
Thomas Risberg, Juergen Hoeller, Rossen Stoyanchev
See Also:
  • Constructor Details

    • AbstractCheckedElementTag

      public AbstractCheckedElementTag()
  • Method Details

    • renderFromValue

      protected void renderFromValue(@Nullable Object value, TagWriter tagWriter) throws JspException
      Render the 'input(checkbox)' with the supplied value, marking the 'input' element as 'checked' if the supplied value matches the bound value.
      Throws:
      JspException
    • renderFromValue

      protected void renderFromValue(@Nullable Object item, @Nullable Object value, TagWriter tagWriter) throws JspException
      Render the 'input(checkbox)' with the supplied value, marking the 'input' element as 'checked' if the supplied value matches the bound value.
      Throws:
      JspException
    • renderFromBoolean

      protected void renderFromBoolean(Boolean boundValue, TagWriter tagWriter) throws JspException
      Render the 'input(checkbox)' with the supplied value, marking the 'input' element as 'checked' if the supplied Boolean is true.
      Throws:
      JspException
    • autogenerateId

      @Nullable protected String autogenerateId() throws JspException
      Return a unique ID for the bound name within the current PageContext.
      Overrides:
      autogenerateId in class AbstractDataBoundFormElementTag
      Throws:
      JspException
    • writeTagContent

      protected abstract int writeTagContent(TagWriter tagWriter) throws JspException
      Writes the 'input' element to the supplied TagWriter, marking it as 'checked' if appropriate.
      Specified by:
      writeTagContent in class AbstractFormTag
      Returns:
      valid tag render instruction as per Tag.doStartTag().
      Throws:
      JspException
    • isValidDynamicAttribute

      protected boolean isValidDynamicAttribute(String localName, Object value)
      Flags "type" as an illegal dynamic attribute.
      Overrides:
      isValidDynamicAttribute in class AbstractHtmlElementTag
    • getInputType

      protected abstract String getInputType()
      Return the type of the HTML input element to generate: "checkbox" or "radio".