Package org.apache.maven.doxia.util
Class ByLineReaderSource
- java.lang.Object
-
- org.apache.maven.doxia.util.ByLineReaderSource
-
- All Implemented Interfaces:
ByLineSource
public class ByLineReaderSource extends java.lang.Object implements ByLineSource
ByLineSourcedefault implementation- Version:
- $Id: ByLineReaderSource.java 1726913 2016-01-26 22:01:54Z rfscholte $
-
-
Constructor Summary
Constructors Constructor Description ByLineReaderSource(java.io.Reader in)Creates the ByLineReaderSource.ByLineReaderSource(java.io.Reader in, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()close the source.intgetLineNumber()getLineNumber.java.lang.StringgetName()getName.java.lang.StringgetNextLine()getNextLine.voidunget(java.lang.String s)unget.voidungetLine()ungetLine.
-
-
-
Method Detail
-
getNextLine
public final java.lang.String getNextLine() throws ParseExceptiongetNextLine.
- Specified by:
getNextLinein interfaceByLineSource- Returns:
- the next line.
nullif we reached the end. - Throws:
ParseException- on I/O error
-
getName
public final java.lang.String getName()
getName.
- Specified by:
getNamein interfaceByLineSource- Returns:
- the name of the input. could be the filename for example.
-
getLineNumber
public final int getLineNumber()
getLineNumber.
- Specified by:
getLineNumberin interfaceByLineSource- Returns:
- the current line number.
-
close
public final void close()
close the source.- Specified by:
closein interfaceByLineSource
-
ungetLine
public final void ungetLine()
ungetLine.
This should throw a java.lang.IllegalStateException if called more than one time without calling getNextLine().- Specified by:
ungetLinein interfaceByLineSource
-
unget
public final void unget(java.lang.String s)
unget.
- Specified by:
ungetin interfaceByLineSource- 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().
-
-