java.lang.Object
net.kyori.adventure.text.minimessage.internal.parser.node.ElementNode
net.kyori.adventure.text.minimessage.internal.parser.node.TagNode
All Implemented Interfaces:
Node

public final class TagNode extends ElementNode
Node that represents a tag.
Since:
4.10.0
  • Constructor Details

    • TagNode

      public TagNode(ElementNode parent, Token token, String sourceMessage, TokenParser.TagProvider tagProvider)
      Creates a new element node.
      Parameters:
      parent - the parent of this node
      token - the token that created this node
      sourceMessage - the source message
      tagProvider - the tag provider
      Since:
      4.10.0
  • Method Details

    • parts

      public List<TagPart> parts()
      Returns the parts of this tag.
      Returns:
      the parts
      Since:
      4.10.0
    • name

      public String name()
      Returns the name of this tag.
      Returns:
      the name
      Since:
      4.10.0
    • token

      public Token token()
      Description copied from class: ElementNode
      Returns the token that lead to the creation of this token.
      Overrides:
      token in class ElementNode
      Returns:
      the token
    • tag

      public Tag tag()
      Gets the tag attached to this tag node.
      Returns:
      the tag for this tag node
      Since:
      4.10.0
    • tag

      public void tag(Tag tag)
      Sets the tag logic that is represented by this tag node.
      Parameters:
      tag - the tag logic
      Since:
      4.10.0
    • buildToString

      public StringBuilder buildToString(StringBuilder sb, int indent)
      Description copied from class: ElementNode
      Serializes this node to a string.
      Overrides:
      buildToString in class ElementNode
      Parameters:
      sb - the string builder to serialize into
      indent - the current indent level
      Returns:
      the passed string builder, for chaining