java.lang.Object
org.jdrupes.mdoclet.internal.doclets.toolkit.Content
org.jdrupes.mdoclet.internal.doclets.formats.html.markup.Text

public class Text extends Content
Class for containing immutable string content for HTML tags of javadoc output.

Newlines are always represented by \n. Any special HTML characters will be escaped if and when the content is written out.

  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    static final Text
     
    static final String
    The newline character, to be used when creating Content nodes.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    int
    Gibt the number of characters of plain text content in this object zurück.
    boolean
    Returns true if the content is empty.
    Returns a given string with all newlines in the form \n.
    static Text
    of(CharSequence content)
    Creates a new object containing immutable text.
    Returns a string representation of the content.
    boolean
    write(Writer out, String newline, boolean atNewline)
    Writes content to a writer, using a given newline sequence, which should be either \n or the platform line separator.

    Von Klasse geerbte Methoden org.jdrupes.mdoclet.internal.doclets.toolkit.Content

    add, add, addAll, isDiscardable

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Felddetails

  • Methodendetails

    • of

      public static Text of(CharSequence content)
      Creates a new object containing immutable text.
      Parameter:
      content - the text content
      Gibt zurück:
      the object
    • isEmpty

      public boolean isEmpty()
      Beschreibung aus Klasse kopiert: Content
      Returns true if the content is empty.
      Angegeben von:
      isEmpty in Klasse Content
      Gibt zurück:
      true if no content to be displayed else return false
    • charCount

      public int charCount()
      Beschreibung aus Klasse kopiert: Content
      Gibt the number of characters of plain text content in this object zurück.
      Setzt außer Kraft:
      charCount in Klasse Content
      Gibt zurück:
      the number of characters of plain text content in this object
    • toString

      public String toString()
      Beschreibung aus Klasse kopiert: Content
      Returns a string representation of the content.

      Newlines are represented by \n.

      Setzt außer Kraft:
      toString in Klasse Content
      Gibt zurück:
      string representation of the content
    • write

      public boolean write(Writer out, String newline, boolean atNewline) throws IOException
      Beschreibung aus Klasse kopiert: Content
      Writes content to a writer, using a given newline sequence, which should be either \n or the platform line separator.
      Angegeben von:
      write in Klasse Content
      Parameter:
      out - the writer
      newline - the newline sequence to use
      atNewline - whether the writer has just written a newline
      Gibt zurück:
      whether the writer has just written a newline
      Löst aus:
      IOException - if an error occurs while writing the output
    • normalizeNewlines

      Returns a given string with all newlines in the form \n.

      The sequences of interest are \n, \r\n, and \r. \n is already in the right form, so can be ignored, leaving code to handle \r\n, and \r.

      Parameter:
      text - the string
      Gibt zurück:
      the string with newlines in the form \n