Class KStringHTMLDynamicTag<TARGET>

    • Constructor Detail

      • KStringHTMLDynamicTag

        public KStringHTMLDynamicTag​(KStringTag.Type type,
                                     int position,
                                     int ordinal,
                                     java.util.LinkedHashMap<java.lang.String,​java.lang.String> attributes)
        Creates a normal tag.
        Parameters:
        type - The tag type.
        position - The position of the tag in the parsed string.
        attributes - The tag attributes.
    • Method Detail

      • isReferenceTag

        public final boolean isReferenceTag()
        Checks if this tag is of reference type, i.e. for HTML, the tags A, IMG, IZ. For PLAIN KString type, this method always returns true.
        Overrides:
        isReferenceTag in class KStringHTMLTag<TARGET>
      • getReference

        public abstract java.lang.String getReference()
        Gets the reference of this tag.
        Overrides:
        getReference in class KStringTag<TARGET>
        Returns:
        The reference, or null for none.
      • willLoseFormatting

        public abstract boolean willLoseFormatting()
        Checks if this string will lose formatting when translated to PLAIN. Note that translating PLAIN to HTML never loses formatting.
        Overrides:
        willLoseFormatting in class KStringHTMLTag<TARGET>
        Returns:
        Always true for opened tags.
      • getPLAINTagText

        public abstract java.lang.String getPLAINTagText​(java.lang.StringBuilder useme)
        Gets the "unparsed" string representation of this tag in the PLAIN format, i.e. this HTML tag will reformat or translate itself for PLAIN. For the basic HTML tags, this results in an empty string.
        Overrides:
        getPLAINTagText in class KStringHTMLTag<TARGET>
      • getHTMLTagText

        public final java.lang.String getHTMLTagText​(java.lang.StringBuilder useme,
                                                     IKStringInfoProvider provider)
        Gets the "unparsed" string representation of this tag in the HTML format.
        Overrides:
        getHTMLTagText in class KStringHTMLTag<TARGET>
        Parameters:
        useme - Temporary StringBuilder for any use.
        provider - The information provider or null for none.
      • getPLAINString

        public abstract java.lang.String getPLAINString​(java.lang.StringBuilder useme,
                                                        IKStringInfoProvider provider)
        Gets the string representation of this tag in the PLAIN format, i.e. returns empty string.
        Overrides:
        getPLAINString in class KStringHTMLTag<TARGET>
        Parameters:
        useme - Temporary StringBuilder for any use.
        provider - The information provider or null for none.
      • getHTMLString

        public java.lang.String getHTMLString​(java.lang.StringBuilder useme,
                                              IKStringInfoProvider provider)
        Gets the string representation of this tag in the HTML format. Method needs to be overridden for IZ that replaces the entire tag with an HTML string.
        Overrides:
        getHTMLString in class KStringHTMLTag<TARGET>
        Parameters:
        useme - Temporary StringBuilder for any use.
        provider - The information provider or null for none.