Class Format.Literal

java.lang.Object
eu.bandm.tools.format.Format
eu.bandm.tools.format.Format.Literal
All Implemented Interfaces:
Formattable, Serializable, Cloneable
Enclosing class:
Format

public static class Format.Literal extends Format
Printed literally to the output. May, but should not, contain whitespace. This will not be correctly formatted, unlike explicit Format.Space instances. Should not contain newlines. The factory method Format.literal(String) ensures the latter.
See Also:
  • Field Details

    • content

      public final String content
      The visible string content to print .
  • Constructor Details

    • Literal

      protected Literal(String s)
      Constructor which unsets the indent value. The factory methods Format.literal(String) is preferable.
    • Literal

      protected Literal(String s, int i)
      Constructor which sets the text contents and the indent value. The factory methods Format.literal(String) is preferable.
  • Method Details

    • doprint

      protected void doprint(Format.FormatPrinter v)
      Description copied from class: Format
      Over-ridden by all sub-classes of Format, for performing the adquate print operations. To be printed is the raison d'ĂȘtre of Format objects. These methods do not use the Visitor/Matcher framework, but direct method invocation and basic method dispatch for descending to child nodes.
      Specified by:
      doprint in class Format
    • debugPrefix

      public String debugPrefix(int n)
      Description copied from class: Format
      Overridden by subclasses to deliver a printable representation for debugging purpose.
      Specified by:
      debugPrefix in class Format
      Parameters:
      n - the maximal number of characters
    • indent

      public Format.Literal indent(int i)
      Description copied from class: Format
      Returns a clone of this with the new value of Format.indent. (The built-in "clone()" functionality cannot be used, since field "indent" is final).
      Specified by:
      indent in class Format