Class LineBreaker

java.lang.Object
org.apache.maven.doxia.util.LineBreaker

@Deprecated public class LineBreaker extends Object
Deprecated.
no longer used by Doxia and scheduled for removal in 2.3.0. It also swallows every write failure, so a failing writer would produce a silently truncated file.
Allows to specify the line-length of an output writer.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Deprecated.
    The default maximal line length.
    private Writer
    Deprecated.
    The destination writer.
    private static final String
    Deprecated.
    The system dependent EOL.
    private int
    Deprecated.
    The current line length.
    private int
    Deprecated.
    The maximal line length.
    Deprecated.
    The string buffer to store the current text.
    Deprecated.
    The writer to use.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Constructs a new LineBreaker with DEFAULT_MAX_LINE_LENGTH.
    LineBreaker(Writer out, int max)
    Deprecated.
    Constructs a new LineBreaker with the given max line length.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated.
    Close the writer.
    void
    Deprecated.
    Write out the current StringBuilder and flush the writer.
    Deprecated.
    Returns the current destination writer.
    void
    write(String text)
    Deprecated.
    Writes the given text to the writer.
    void
    write(String text, boolean preserveSpace)
    Deprecated.
    Writes the given text to the writer.
    private void
    Deprecated.
    Writes the current StringBuilder to the writer.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_MAX_LINE_LENGTH

      public static final int DEFAULT_MAX_LINE_LENGTH
      Deprecated.
      The default maximal line length.
      See Also:
    • EOL

      private static final String EOL
      Deprecated.
      The system dependent EOL.
    • destination

      private Writer destination
      Deprecated.
      The destination writer.
    • writer

      private BufferedWriter writer
      Deprecated.
      The writer to use.
    • maxLineLength

      private int maxLineLength
      Deprecated.
      The maximal line length.
    • lineLength

      private int lineLength
      Deprecated.
      The current line length.
    • word

      private StringBuilder word
      Deprecated.
      The string buffer to store the current text.
  • Constructor Details

    • LineBreaker

      public LineBreaker(Writer out)
      Deprecated.
      Constructs a new LineBreaker with DEFAULT_MAX_LINE_LENGTH.
      Parameters:
      out - The writer to use.
    • LineBreaker

      public LineBreaker(Writer out, int max)
      Deprecated.
      Constructs a new LineBreaker with the given max line length.
      Parameters:
      out - The writer to use.
      max - The maximal line length.
  • Method Details

    • getDestination

      public Writer getDestination()
      Deprecated.
      Returns the current destination writer.
      Returns:
      The destination.
    • write

      public void write(String text) throws IOException
      Deprecated.
      Writes the given text to the writer. White space is not preserved.
      Parameters:
      text - The text to write.
      Throws:
      IOException - if there's a problem writing the text.
    • write

      public void write(String text, boolean preserveSpace)
      Deprecated.
      Writes the given text to the writer.
      Parameters:
      text - The text to write.
      preserveSpace - True to preserve white space.
    • flush

      public void flush()
      Deprecated.
      Write out the current StringBuilder and flush the writer. Any IOException will be swallowed.
    • writeWord

      private void writeWord() throws IOException
      Deprecated.
      Writes the current StringBuilder to the writer.
      Throws:
      IOException - if an exception occurs during writing.
    • close

      public void close()
      Deprecated.
      Close the writer.