|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.socialchange.doctype.DoctypeParser
public class DoctypeParser
Class for parsing a Doctype declaration and storing read information for
later retrieval. Straightforward state machine implementation.
If the parse fails for any reason,
the parse(InputStream, StringBuffer)
method will silently return. You
can retrieve an error message through getErrorMessage()
.
Note: you can get this info through standard SAX and DOM methods. This is a
pre-parser so that we can implement conditional replacement of Doctype
declaration components.
Field Summary | |
---|---|
protected int |
debug
The debugging detail level for this component. |
Constructor Summary | |
---|---|
DoctypeParser()
Instantiate a parser. |
|
DoctypeParser(int debugLevel)
Instantiate a parser, with a certain debug level. |
Method Summary | |
---|---|
Doctype |
getDoctype()
|
java.lang.String |
getErrorMessage()
If a parse failed, this will return any error message associated with the failure |
void |
log(int s)
|
void |
log(java.lang.String s)
|
void |
parse(java.io.InputStream in)
Parse a doctype declaration. |
void |
parse(java.io.InputStream in,
java.lang.StringBuffer buf)
Parse a doctype declaration, storing read characters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final int debug
Constructor Detail |
---|
public DoctypeParser()
public DoctypeParser(int debugLevel)
Method Detail |
---|
public void parse(java.io.InputStream in) throws java.io.IOException
in
- An InputStream where the next character will be somewhere in
the text <!Doctype
.
java.io.IOException
getErrorMessage()
public void parse(java.io.InputStream in, java.lang.StringBuffer buf) throws java.io.IOException
in
- An InputStream where the next character will be somewhere in
the text <!Doctype
.buf
- The StringBuffer to store read characters to. If
null
, behave same as parse(InputStream)
.
java.io.IOException
getErrorMessage()
public final Doctype getDoctype()
public java.lang.String getErrorMessage()
public void log(java.lang.String s)
public void log(int s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |