net.socialchange.doctype
Class DoctypeChangerStream
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.FilterInputStream
|
+--net.socialchange.doctype.DoctypeChangerStream
- public final class DoctypeChangerStream
- extends java.io.FilterInputStream
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.
- Version:
- $Revision: 1.6 $ $Date: 2002/04/15 01:02:03 $
- Author:
- Simon St.Laurent, Nigel Whitaker, Jeff Turner
| Fields inherited from class java.io.FilterInputStream |
in |
| 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 |
doctype
protected Doctype doctype
generator
protected DoctypeGenerator generator
docStarted
protected boolean docStarted
inComment
protected boolean inComment
myBuffer
protected java.lang.StringBuffer myBuffer
DoctypeChangerStream
public DoctypeChangerStream(java.io.InputStream in)
- Constructor.
- Parameters:
in - The InputStream which will return XML/SGML.
setGenerator
public void setGenerator(DoctypeGenerator generator)
- Set the Generator which will determine the policy for what to do with the
DOCTYPE declaration. See the package overview for more details.
getDoctype
public Doctype getDoctype()
- Get the Doctype set for the parsed stream. If no DOCTYPE declaration was
set, this will be
null. Likewise if you call this before
doing the parse.
read
public int read()
throws java.io.IOException
- Overrides:
read in class java.io.FilterInputStream
read
public int read(byte[] text,
int offset,
int length)
throws java.io.IOException
- Overrides:
read in class java.io.FilterInputStream
addDocType
protected void addDocType()
- Add the DOCTYPE declaration to the buffer, from which it will be read in
subsequent
read() operations.
We add some line separators here for readability.
feedFromInternalBuffer
protected int feedFromInternalBuffer()
Copyright © 2001 Social Change Online. All Rights Reserved.