Class ByLineReaderSource

java.lang.Object
org.apache.maven.doxia.util.ByLineReaderSource
All Implemented Interfaces:
ByLineSource

public class ByLineReaderSource extends Object implements ByLineSource
ByLineSource default implementation
  • Field Details

    • reader

      private LineNumberReader reader
      reader
    • lineNumber

      private int lineNumber
      current line number
    • lastLine

      private String lastLine
      holds the last line returned by getNextLine()
    • ungetted

      private boolean ungetted
      true if ungetLine() was called and no getNextLine() was called
    • name

      private String name
  • Constructor Details

    • ByLineReaderSource

      public ByLineReaderSource(Reader in)
      Creates the ByLineReaderSource.
      Parameters:
      in - real source :)
    • ByLineReaderSource

      public ByLineReaderSource(Reader in, String name)

      Constructor for ByLineReaderSource.

      Parameters:
      in - a Reader object.
      name - a String object.
  • Method Details

    • getNextLine

      public final String getNextLine() throws ParseException

      getNextLine.

      Specified by:
      getNextLine in interface ByLineSource
      Returns:
      a String object.
      Throws:
      ParseException - if any.
    • getName

      public final String getName()

      getName.

      Specified by:
      getName in interface ByLineSource
      Returns:
      a String object.
    • getLineNumber

      public final int getLineNumber()

      getLineNumber.

      Specified by:
      getLineNumber in interface ByLineSource
      Returns:
      a int.
    • close

      public final void close()
      close the source.
      Specified by:
      close in interface ByLineSource
    • ungetLine

      public final void ungetLine()

      ungetLine.

      This should throw a java.lang.IllegalStateException if called more than one time without calling getNextLine().
      Specified by:
      ungetLine in interface ByLineSource
    • unget

      public final void unget(String s)

      unget.

      Specified by:
      unget in interface ByLineSource
      Parameters:
      s - some text to push back to the parser. This should throw a java.lang.IllegalStateException if called more than one time without calling getNextLine().