|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
net.socialchange.doctype.DoctypeChangerStream
public final class DoctypeChangerStream
This class adds, removes or otherwise modifies a DOCTYPE declaration to an incoming XML document.
For examples of how to use this, see the package overview.
Field Summary | |
---|---|
protected boolean |
docStarted
|
protected Doctype |
doctype
|
protected DoctypeGenerator |
generator
|
protected boolean |
inComment
|
protected java.lang.StringBuffer |
myBuffer
|
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
DoctypeChangerStream(java.io.InputStream in)
Constructor. |
Method Summary | |
---|---|
protected void |
addDocType()
Add the DOCTYPE declaration to the buffer, from which it will be read in subsequent read() operations. |
protected int |
feedFromInternalBuffer()
|
Doctype |
getDoctype()
Get the Doctype set for the parsed stream. |
int |
read()
|
int |
read(byte[] text,
int offset,
int length)
|
void |
setGenerator(DoctypeGenerator generator)
Set the Generator which will determine the policy for what to do with the DOCTYPE declaration. |
Methods inherited from class java.io.FilterInputStream |
---|
available, close, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Doctype doctype
protected DoctypeGenerator generator
protected boolean docStarted
protected boolean inComment
protected java.lang.StringBuffer myBuffer
Constructor Detail |
---|
public DoctypeChangerStream(java.io.InputStream in)
in
- The InputStream which will return XML/SGML.Method Detail |
---|
public void setGenerator(DoctypeGenerator generator)
public Doctype getDoctype()
null
. Likewise if you call this before
doing the parse.
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] text, int offset, int length) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
protected void addDocType()
read()
operations.
We add some line separators here for readability.
protected int feedFromInternalBuffer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |