Interface org.jfouffa.parser.html.Reader
- public interface Reader
The input stream for the Parser
Method index
-
close()
- Close the stream.
-
getColumn()
- Returns the current column number.
-
getLine()
- Returns the current line number.
-
gotoMark()
- Go to the last mark() call
Any call to pushback function show invalid this call.
-
mark()
- Mark the current position of the stream.
-
peek()
- Peek a character in the stream.
-
pushback(char)
- Push back a chacracter into the stream.
-
pushback(String)
- Push back a string into the stream.
-
read()
- Read a single character.
-
see()
- DEBUG
Methods
read
public abstract int read() throws IOException
- Read a single character. This method will block until a character is
available, an I/O error occurs, or the end of the stream is reached.
Subclasses that intend to support efficient single-character input
should override this method.
- Returns:
- The character read, as an integer in the range 0 to 16383
(0x00-0xffff), or -1 if the end of the stream has
been reached
- Throws: IOException
- If an I/O error occurs
peek
public abstract int peek() throws IOException
- Peek a character in the stream.
- Returns:
- The character read, as an integer in the range 0 to 16383
(0x00-0xffff), or -1 if the end of the stream has
been reached
- Throws: IOException
- If an I/O error occurs
pushback
public abstract void pushback(String s)
- Push back a string into the stream.
- Parameters:
- s - the string to push back.
pushback
public abstract void pushback(char c)
- Push back a chacracter into the stream.
- Parameters:
- c - the character to push back.
getLine
public abstract int getLine()
- Returns the current line number.
- Returns:
- the current line number
getColumn
public abstract int getColumn()
- Returns the current column number.
- Returns:
- the current column number.
close
public abstract void close() throws IOException
- Close the stream. Once a stream has been closed, further read(),
ready(), mark(), or reset() invocations will throw an IOException.
Closing a previously-closed stream, however, has no effect.
- Throws: IOException
- If an I/O error occurs
mark
public abstract void mark() throws IOException
- Mark the current position of the stream.
gotoMark
public abstract void gotoMark() throws IOException
- Go to the last mark() call
Any call to pushback function show invalid this call. A call to
the read function can invalid this call (depends on your implements).
Typically, the parser calls this function to check a small part of the
stream (for example, a name followed by a semi-colon).
- Throws: IOException
- the last mark can't be reached or no mark set.
see
public abstract void see()
- DEBUG