Enum Class TagContent

java.lang.Object
java.lang.Enum<TagContent>
com.webfirmframework.wffweb.tag.htmlwff.TagContent
All Implemented Interfaces:
Serializable, Comparable<TagContent>, Constable

public enum TagContent extends Enum<TagContent>
Since:
3.0.2
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    content type is HTML
    content type is plain text
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all children from the given parent tag and appends the given content on the given parent tag either as text or HTML based on the enum constant
    void
    addInnerContents(AbstractHtml parent, String... contents)
    Removes all children from the given parent tag and appends the given contents on the given parent tag either as text or HTML based on the enum constant
    boolean
    appendChild(AbstractHtml parent, String content)
    appends the given content on the given parent tag either as text or HTML based on the enum constant
    void
    appendChildren(AbstractHtml parent, String... contents)
    appends the given contents on the given parent tag either as text or HTML based on the enum constant
    static <R extends AbstractHtml>
    R
    appendHtml(R parent, String content)
    Appends content in the given parent object as the last child.
    static <R extends AbstractHtml>
    R
    appendText(R parent, String content)
    Appends content in the given parent object as the last child.
    static <R extends AbstractHtml>
    R
    html(R parent, String content)
    Adds inner content for the given parent object, children of parent will be removed if already exists.
    boolean
    insertAfter(AbstractHtml parent, String content)
    Inserts the given content after given parent tag either as text or HTML based on the enum constant.
    boolean
    insertAfter(AbstractHtml parent, String... contents)
    Inserts the given contents after given parent tag either as text or HTML based on the enum constant.
    boolean
    insertBefore(AbstractHtml parent, String content)
    Inserts the given content before given parent tag either as text or HTML based on the enum constant.
    boolean
    insertBefore(AbstractHtml parent, String... contents)
    Inserts the given contents before given parent tag either as text or HTML based on the enum constant.
    void
    prependChild(AbstractHtml parent, String content)
    prepends the given content on the given parent tag either as text or HTML based on the enum constant
    void
    prependChildren(AbstractHtml parent, String... contents)
    prepends the given contents on the given parent tag either as text or HTML based on the enum constant
    static <R extends AbstractHtml>
    R
    prependHtml(R parent, String content)
    Prepends content in the given parent object as the first child.
    static <R extends AbstractHtml>
    R
    prependText(R parent, String content)
    Prepends content in the given parent object as the first child.
    void
    Removes all children from the given parent tag and appends the given content on the given parent tag either as text or HTML based on the enum constant
    void
    replaceChildren(AbstractHtml parent, String... contents)
    Removes all children from the given parent tag and appends the given contents on the given parent tag either as text or HTML based on the enum constant
    static <R extends AbstractHtml>
    R
    text(R parent, String content)
    Adds inner content for the given parent object, children of parent will be removed if already exists.
    static TagContent
    Returns the enum constant of this class with the specified name.
    static TagContent[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • TEXT

      public static final TagContent TEXT
      content type is plain text
    • HTML

      public static final TagContent HTML
      content type is HTML
  • Method Details

    • values

      public static TagContent[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TagContent valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • text

      public static <R extends AbstractHtml> R text(R parent, String content)
      Adds inner content for the given parent object, children of parent will be removed if already exists.
      Parameters:
      parent -
      content -
      Returns:
      parent
      Since:
      3.0.13
    • prependText

      public static <R extends AbstractHtml> R prependText(R parent, String content)
      Prepends content in the given parent object as the first child.
      Parameters:
      parent -
      Returns:
      parent
      Since:
      3.0.13
    • appendText

      public static <R extends AbstractHtml> R appendText(R parent, String content)
      Appends content in the given parent object as the last child.
      Parameters:
      parent -
      Returns:
      parent
      Since:
      3.0.13
    • html

      public static <R extends AbstractHtml> R html(R parent, String content)
      Adds inner content for the given parent object, children of parent will be removed if already exists. It internally marks the given content type as html.
      Parameters:
      parent -
      Returns:
      parent
      Since:
      3.0.13
    • prependHtml

      public static <R extends AbstractHtml> R prependHtml(R parent, String content)
      Prepends content in the given parent object as the first child. It internally marks the given content type as html.
      Parameters:
      parent -
      Returns:
      parent
      Since:
      3.0.13
    • appendHtml

      public static <R extends AbstractHtml> R appendHtml(R parent, String content)
      Appends content in the given parent object as the last child. It internally marks the given content type as html.
      Parameters:
      parent -
      Returns:
      parent
      Since:
      3.0.13
    • appendChildren

      public void appendChildren(AbstractHtml parent, String... contents)
      appends the given contents on the given parent tag either as text or HTML based on the enum constant
      Parameters:
      parent - the tag on which the operation to be done.
      contents - contents to append to the given parent tag.
      Throws:
      InvalidTagException - if the given tag instance is not supported for this operation.
      Since:
      3.0.2
    • appendChild

      public boolean appendChild(AbstractHtml parent, String content)
      appends the given content on the given parent tag either as text or HTML based on the enum constant
      Parameters:
      parent - the tag on which the operation to be done.
      content - content to append to the given parent tag.
      Returns:
      true if appended
      Throws:
      InvalidTagException - if the given tag instance is not supported for this operation.
      Since:
      3.0.2
    • prependChild

      public void prependChild(AbstractHtml parent, String content)
      prepends the given content on the given parent tag either as text or HTML based on the enum constant
      Parameters:
      parent - the tag on which the operation to be done.
      content - content to prepend to the given parent tag.
      Throws:
      InvalidTagException - if the given tag instance is not supported for this operation.
      Since:
      3.0.2
    • prependChildren

      public void prependChildren(AbstractHtml parent, String... contents)
      prepends the given contents on the given parent tag either as text or HTML based on the enum constant
      Parameters:
      parent - the tag on which the operation to be done.
      contents - contents to prepend to the given parent tag.
      Throws:
      InvalidTagException - if the given tag instance is not supported for this operation.
      Since:
      3.0.2
    • insertBefore

      public boolean insertBefore(AbstractHtml parent, String content)
      Inserts the given content before given parent tag either as text or HTML based on the enum constant. There must be a parent for the given parent tag.
      Parameters:
      parent - the tag on which the operation to be done.
      content - content to insert before the given parent tag.
      Returns:
      true if inserted
      Since:
      3.0.2
    • insertBefore

      public boolean insertBefore(AbstractHtml parent, String... contents)
      Inserts the given contents before given parent tag either as text or HTML based on the enum constant. There must be a parent for the given parent tag.
      Parameters:
      parent - the tag on which the operation to be done.
      contents - contents to insert before the given parent tag.
      Returns:
      true if inserted
      Since:
      3.0.2
    • insertAfter

      public boolean insertAfter(AbstractHtml parent, String content)
      Inserts the given content after given parent tag either as text or HTML based on the enum constant. There must be a parent for the given parent tag.
      Parameters:
      parent - the tag on which the operation to be done.
      content - content to insert after the given parent tag.
      Returns:
      true if inserted
      Since:
      3.0.2
    • insertAfter

      public boolean insertAfter(AbstractHtml parent, String... contents)
      Inserts the given contents after given parent tag either as text or HTML based on the enum constant. There must be a parent for the given parent tag.
      Parameters:
      parent - the tag on which the operation to be done.
      contents - contents to insert after the given parent tag.
      Returns:
      true if inserted
      Since:
      3.0.2
    • replaceChildren

      public void replaceChildren(AbstractHtml parent, String content)
      Removes all children from the given parent tag and appends the given content on the given parent tag either as text or HTML based on the enum constant
      Parameters:
      parent - the tag on which the operation to be done.
      content - replacement content for the children of the given parent.
      Throws:
      InvalidTagException - if the given tag instance is not supported for this operation.
      InvalidTagException - if the given tag instance is not supported for this operation.
      Since:
      3.0.2
    • replaceChildren

      public void replaceChildren(AbstractHtml parent, String... contents)
      Removes all children from the given parent tag and appends the given contents on the given parent tag either as text or HTML based on the enum constant
      Parameters:
      parent - the tag on which the operation to be done.
      contents - replacement contents for the children of the given parent.
      Throws:
      InvalidTagException - if the given tag instance is not supported for this operation.
      Since:
      3.0.2
    • addInnerContent

      public void addInnerContent(AbstractHtml parent, String content)
      Removes all children from the given parent tag and appends the given content on the given parent tag either as text or HTML based on the enum constant
      Parameters:
      parent - the tag on which the operation to be done.
      content - replacement content for the children of the given parent.
      Throws:
      InvalidTagException - if the given tag instance is not supported for this operation.
      Since:
      3.0.2
    • addInnerContents

      public void addInnerContents(AbstractHtml parent, String... contents)
      Removes all children from the given parent tag and appends the given contents on the given parent tag either as text or HTML based on the enum constant
      Parameters:
      parent - the tag on which the operation to be done.
      contents - replacement contents for the children of the given parent.
      Throws:
      InvalidTagException - if the given tag instance is not supported for this operation.
      Since:
      3.0.2