Package jodd.lagarto

Interface Tag


  • public interface Tag
    Tag definition.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addAttribute​(java.lang.CharSequence name, java.lang.CharSequence value)
      Adds new attribute without checking if it already exist thus allowing duplicate attributes.
      int getAttributeCount()
      Returns number of tag attributes.
      int getAttributeIndex​(java.lang.CharSequence name)
      Returns attribute index or -1 if not found.
      java.lang.CharSequence getAttributeName​(int index)
      Returns attribute name.
      java.lang.CharSequence getAttributeValue​(int index)
      Returns attribute value or null for an empty attribute,
      java.lang.CharSequence getAttributeValue​(java.lang.CharSequence name)
      Returns attribute value or null for an empty attribute, Returns null also if attribute name does not exist.
      int getDeepLevel()
      Returns 1-based deep level of a tag from the root.
      java.lang.CharSequence getId()
      Returns id attribute value of a tag.
      java.lang.CharSequence getName()
      Returns tags name.
      java.lang.String getPosition()
      Returns tag position string or null if position is not calculated.
      int getTagLength()
      Returns tag length in the input source.
      int getTagPosition()
      Returns tag position in the input source.
      TagType getType()
      Returns type of tag (e.g.
      boolean hasAttribute​(java.lang.CharSequence name)
      Detects if an attribute is present.
      boolean isCaseSensitive()
      Returns case-sensitive flag for various name matching.
      boolean isModified()
      Returns true if tag is modified.
      boolean isRawTag()
      Returns true if tag should parse inner text content as RAWTEXT.
      boolean nameEquals​(java.lang.CharSequence charSequence)
      Returns true if name equals to given char sequence.
      void removeAttribute​(int index)
      Removes attribute at given index.
      void removeAttribute​(java.lang.CharSequence name)
      Removes attribute by given name.
      void removeAttributes()
      Removes all attributes.
      void setAttribute​(java.lang.CharSequence name, java.lang.CharSequence value)
      Sets new attribute value.
      void setAttributeName​(int index, java.lang.CharSequence name)
      Changes attribute name on specific index.
      void setAttributeValue​(int index, java.lang.CharSequence value)
      Sets value for attribute at specific index.
      void setAttributeValue​(java.lang.CharSequence name, java.lang.CharSequence value)
      Sets value for attribute with given name.
      void setName​(java.lang.CharSequence tagName)
      Sets tag name.
      void setType​(TagType type)
      Sets tag type.
      java.lang.String toString()
      Get the complete tag as a string.
      void writeTo​(java.lang.Appendable out)
      Writes the tag to the output.
    • Method Detail

      • isCaseSensitive

        boolean isCaseSensitive()
        Returns case-sensitive flag for various name matching.
      • isRawTag

        boolean isRawTag()
        Returns true if tag should parse inner text content as RAWTEXT.
      • getName

        java.lang.CharSequence getName()
        Returns tags name.
      • getDeepLevel

        int getDeepLevel()
        Returns 1-based deep level of a tag from the root.
      • getAttributeCount

        int getAttributeCount()
        Returns number of tag attributes.
      • getAttributeName

        java.lang.CharSequence getAttributeName​(int index)
        Returns attribute name.
      • getAttributeValue

        java.lang.CharSequence getAttributeValue​(int index)
        Returns attribute value or null for an empty attribute,
      • getAttributeValue

        java.lang.CharSequence getAttributeValue​(java.lang.CharSequence name)
        Returns attribute value or null for an empty attribute, Returns null also if attribute name does not exist.
      • getAttributeIndex

        int getAttributeIndex​(java.lang.CharSequence name)
        Returns attribute index or -1 if not found.
      • hasAttribute

        boolean hasAttribute​(java.lang.CharSequence name)
        Detects if an attribute is present.
      • getTagPosition

        int getTagPosition()
        Returns tag position in the input source.
      • getTagLength

        int getTagLength()
        Returns tag length in the input source.
      • getPosition

        java.lang.String getPosition()
        Returns tag position string or null if position is not calculated.
      • setName

        void setName​(java.lang.CharSequence tagName)
        Sets tag name.
      • addAttribute

        void addAttribute​(java.lang.CharSequence name,
                          java.lang.CharSequence value)
        Adds new attribute without checking if it already exist thus allowing duplicate attributes.
      • setAttribute

        void setAttribute​(java.lang.CharSequence name,
                          java.lang.CharSequence value)
        Sets new attribute value. If attribute already exist, it's value is changed. If attribute does not exist, it will be added to the tag.
      • setAttributeValue

        void setAttributeValue​(int index,
                               java.lang.CharSequence value)
        Sets value for attribute at specific index. Throws exception if index is invalid.
      • setAttributeValue

        void setAttributeValue​(java.lang.CharSequence name,
                               java.lang.CharSequence value)
        Sets value for attribute with given name. If attribute with given name doesn't exist, nothing changes.
      • setAttributeName

        void setAttributeName​(int index,
                              java.lang.CharSequence name)
        Changes attribute name on specific index. Throws exception if index is invalid.
      • removeAttribute

        void removeAttribute​(int index)
        Removes attribute at given index. Throws exception if index is invalid.
      • removeAttribute

        void removeAttribute​(java.lang.CharSequence name)
        Removes attribute by given name.
      • removeAttributes

        void removeAttributes()
        Removes all attributes.
      • isModified

        boolean isModified()
        Returns true if tag is modified.
      • nameEquals

        boolean nameEquals​(java.lang.CharSequence charSequence)
        Returns true if name equals to given char sequence.
      • writeTo

        void writeTo​(java.lang.Appendable out)
        Writes the tag to the output.
      • toString

        java.lang.String toString()
        Get the complete tag as a string.
        Overrides:
        toString in class java.lang.Object