Class KStringHTMLHyperlinkExternalTag

All Implemented Interfaces:
IKStringHTMLHyperlink, Cloneable

public class KStringHTMLHyperlinkExternalTag extends KStringHTMLDynamicTag<PropCnr> implements IKStringHTMLHyperlink
Class for the dynamic HTML hyperlink A tag that refers to an external source when the user clicks on a hyperlink in HTML text.
Author:
Christopher Mindus
  • Constructor Details

    • KStringHTMLHyperlinkExternalTag

      public KStringHTMLHyperlinkExternalTag(int position, int ordinal, LinkedHashMap<String,String> attributes, String inputString, int parsePosition) throws KStringParseException
      Creates a Resource hyperlink tag and resolves the name attribute.
      Parameters:
      position - The position of the tag in the parsed string.
      attributes - The tag attributes.
      inputString - The input string to KString.
      parsePosition - The parsing position where tag starts.
      Throws:
      KStringParseException - For missing attributes.
  • Method Details

    • setTarget

      public void setTarget(String target)
      Sets the target reference, if supported.
      Specified by:
      setTarget in interface IKStringHTMLHyperlink
      Parameters:
      target - The new target.
    • getReference

      public String getReference()
      Gets the reference of this tag.
      Specified by:
      getReference in class KStringHTMLDynamicTag<PropCnr>
      Returns:
      The reference, or null for none.
    • setReference

      public boolean setReference(String href)
      Sets the "href" external reference.
      Specified by:
      setReference in interface IKStringHTMLHyperlink
      Overrides:
      setReference in class KStringHTMLTag<PropCnr>
      Parameters:
      href - The external reference.
      Returns:
      true for changed, false for no change.
    • getReferenceClass

      public Class<?> getReferenceClass()
      Returns the reference class used by this tag, e.g. KStringProp for text table, or the image class IImageTarget.class.
      Overrides:
      getReferenceClass in class KStringTag<PropCnr>
      Returns:
      null for now!
    • willLoseFormatting

      public 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 KStringHTMLDynamicTag<PropCnr>
      Returns:
      Always true.
    • getPLAINTagText

      public String getPLAINTagText(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.
      Specified by:
      getPLAINTagText in class KStringHTMLDynamicTag<PropCnr>
      Parameters:
      useme - Temporary StringBuilder for any use.
      Returns:
      Empty string always: there is no conversion possible.
    • getPLAINString

      public String getPLAINString(StringBuilder useme, IKStringInfoProvider provider)
      Gets the string representation of this tag in the PLAIN format, i.e. returns empty string.
      Specified by:
      getPLAINString in class KStringHTMLDynamicTag<PropCnr>
      Parameters:
      useme - Temporary StringBuilder for any use.
      provider - The information provider or null for none.
      Returns:
      Empty string always: no contents for this tag.
    • getHTMLString

      public String getHTMLString(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.
      Specified by:
      getHTMLString in interface IKStringHTMLHyperlink
      Overrides:
      getHTMLString in class KStringHTMLDynamicTag<PropCnr>
      Parameters:
      useme - Temporary StringBuilder for any use.
      provider - The information provider or null for none.
      Returns:
      The HTML string.