Class KStringPLAINTag<TARGET extends GProp<?>>

java.lang.Object
com.iizix.text.KStringTag<TARGET>
com.iizix.text.KStringPLAINTag<TARGET>
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
KStringPLAINTextTableTag, KStringPLAINVirtualSpaceTag

public abstract class KStringPLAINTag<TARGET extends GProp<?>> extends KStringTag<TARGET>
Abstract class used by the PLAIN TextTable, VirtualSpace and Connector tags.
Author:
Christopher Mindus
  • Field Details

    • ref

      protected String ref
      The name in the text table.
  • Constructor Details

    • KStringPLAINTag

      public KStringPLAINTag(KStringTag.Type type, String ref, String inputString, int position, LinkedHashMap<String,String> attributes) throws KStringParseException
      Creates a VirtualSpace tag for KString that is of type PLAIN.
      Parameters:
      type - The connector type.
      ref - The reference value.
      inputString - The input string.
      position - The position in the character based and parsed string.
      attributes - The attributes for the tag.
      Throws:
      KStringParseException - If the reference is missing or empty.
  • Method Details

    • getReference

      public final String getReference()
      Gets the reference.
      Overrides:
      getReference in class KStringTag<TARGET extends GProp<?>>
      Returns:
      The reference string to the property.
    • setReference

      public boolean setReference(String ref)
      Updates the reference for the tag.
      Specified by:
      setReference in class KStringTag<TARGET extends GProp<?>>
      Parameters:
      ref - The new reference string.
      Returns:
      true if changed, false for no change.
      Throws:
      NullPointerException - If ref is null.
    • 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.
      Specified by:
      isReferenceTag in class KStringTag<TARGET extends GProp<?>>
    • willLoseFormatting

      public final boolean willLoseFormatting()
      Checks if this string will lose formatting when translated to PLAIN. Note that translating PLAIN to HTML never loses formatting.
      Specified by:
      willLoseFormatting in class KStringTag<TARGET extends GProp<?>>
      Returns:
      Always false.
    • getPLAINTagText

      public final String getPLAINTagText(StringBuilder useme)
      Gets the "unparsed" string representation of this tag in the PLAIN format.
      Specified by:
      getPLAINTagText in class KStringTag<TARGET extends GProp<?>>
    • getHTMLTagText

      public final String getHTMLTagText(StringBuilder useme, IKStringInfoProvider provider)
      Gets the "unparsed" string representation of this tag in the HTML format, e.g. this PLAIN tag will reformat or translate itself for HTML with the IZ type="xx" ref="fullPath" [attr=value] ....
      Specified by:
      getHTMLTagText in class KStringTag<TARGET extends GProp<?>>
      Parameters:
      useme - Temporary StringBuilder for any use.
      provider - The information provider or null for none.
    • equalsName

      public boolean equalsName(KStringTag<?> kst)
      Checks for the same "name" (tag ordinal and closing tag for HTML, tag name for PLAIN).
      Overrides:
      equalsName in class KStringTag<TARGET extends GProp<?>>