|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnu.validator.htmlparser.test.TokenPrinter
public class TokenPrinter
Field Summary | |
---|---|
private Writer |
writer
|
Constructor Summary | |
---|---|
TokenPrinter(Writer writer)
|
Method Summary | |
---|---|
void |
characters(char[] buf,
int start,
int length)
Receive character tokens. |
void |
comment(char[] buf,
int length)
Receive a comment token. |
void |
doctype(String name,
String publicIdentifier,
String systemIdentifier,
boolean correct)
Receive a doctype token. |
void |
endTag(String name,
Attributes attributes)
Receive an end tag token. |
void |
eof()
The end-of-file token. |
void |
error(SAXParseException exception)
|
void |
fatalError(SAXParseException exception)
|
static void |
main(String[] args)
|
void |
start(Tokenizer self)
This method is called at the start of tokenization before any other methods on this interface are called. |
void |
startTag(String name,
Attributes attributes)
Receive a start tag token. |
boolean |
wantsComments()
If this handler implementation cares about comments, return true . |
void |
warning(SAXParseException exception)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Writer writer
Constructor Detail |
---|
public TokenPrinter(Writer writer)
writer
- Method Detail |
---|
public void characters(char[] buf, int start, int length) throws SAXException
TokenHandler
characters
in interface TokenHandler
buf
- a buffer holding the datastart
- offset into the bufferlength
- the number of code units to read
SAXException
- if something went wrongContentHandler.characters(char[], int, int)
public void comment(char[] buf, int length) throws SAXException
TokenHandler
wantsComments()
returned false
.
comment
in interface TokenHandler
buf
- a buffer holding the datalength
- the number of code units to read
SAXException
- if something went wrongpublic void doctype(String name, String publicIdentifier, String systemIdentifier, boolean correct) throws SAXException
TokenHandler
doctype
in interface TokenHandler
name
- the namepublicIdentifier
- the public idsystemIdentifier
- the system idcorrect
- whether the token is correct
SAXException
- if something went wrongpublic void endTag(String name, Attributes attributes) throws SAXException
TokenHandler
endTag
in interface TokenHandler
name
- the tag nameattributes
- the attributes
SAXException
- if something went wrongpublic void eof() throws SAXException
TokenHandler
eof
in interface TokenHandler
SAXException
- if something went wrongpublic void start(Tokenizer self) throws SAXException
TokenHandler
Tokenizer
in order to set the
content model flag and in order to be able to query for
Locator
data.
start
in interface TokenHandler
self
- the Tokenizer
.
SAXException
- if something went wrongpublic void startTag(String name, Attributes attributes) throws SAXException
TokenHandler
startTag
in interface TokenHandler
name
- the tag nameattributes
- the attributes
SAXException
- if something went wrongpublic boolean wantsComments() throws SAXException
TokenHandler
true
.
If not, return false
.
wantsComments
in interface TokenHandler
SAXException
- if something went wrongpublic static void main(String[] args) throws SAXException, IOException
SAXException
IOException
public void error(SAXParseException exception) throws SAXException
error
in interface ErrorHandler
SAXException
public void fatalError(SAXParseException exception) throws SAXException
fatalError
in interface ErrorHandler
SAXException
public void warning(SAXParseException exception) throws SAXException
warning
in interface ErrorHandler
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |