PageMixer API - 3.1

jp.ne.dti.lares.foozy.pagemixer.parser
Interface PageState

All Known Implementing Classes:
LoosePageState

public interface PageState

Parsing context holder to 'token'ize HTML page.

This interface allows to choose implementation for parsing/tokenizing target page.

For example, Someone may want parsing to parse as many as possible it can, but someone may want parsing to parse strictly.


Method Summary
 Token flush()
          Indicate no more character to parse.
 Token input(char c)
          Parse next character.
 void reset()
          Reset current status.
 

Method Detail

input

public Token input(char c)
            throws PageParseException
Parse next character.

Input next character in character sequence of page to parse, and return Token, if it recognizes.

Almost all Token, derived class in fact, consists of so many characters, so this method returns null frequently.

Parameters:
c - next character in page to parse
Returns:
token if recognizes. otherwise null.

flush

public Token flush()
            throws PageParseException
Indicate no more character to parse.

Indicate there is no more character in character sequence of page to parse, and return Token, if it recognizes.

This method works like "input(EOF)".

Returns:
token if recognizes. otherwise null.

reset

public void reset()
Reset current status.

Reset current status of page state to re-use it.

This must not cause PageParseException though flush() may cause.


PageMixer API - 3.1