final class DTDWriter
extends java.lang.Object
DTDReader
when writing out
flattened external DTD subset file. Writing functionality encapsulated
here since it's specific to one mode of operation (flattening).
Note, too, that underlying IOException
s are generally wrapped
as XMLStreamException
s. This is needed to reduce amount of
work caller has to do for wrapping. It will still be possible to
unwrap these exceptions further up the call stack if need be.
Modifier and Type | Field and Description |
---|---|
(package private) int |
mFlattenStart
Pointer to first character in the current input buffer that
has not yet been written to flatten writer.
|
(package private) boolean |
mIncludeComments |
(package private) boolean |
mIncludeConditionals |
(package private) boolean |
mIncludePEs |
(package private) int |
mIsFlattening
Counter that indicates whether flattened output should be written to
(non-null) mWriter; values above zero indicate output is enabled,
zero and below that output is disabled.
|
(package private) java.io.Writer |
mWriter |
Constructor and Description |
---|
DTDWriter(java.io.Writer out,
boolean inclComments,
boolean inclCond,
boolean inclPEs) |
Modifier and Type | Method and Description |
---|---|
void |
disableOutput() |
void |
enableOutput(int newStart) |
void |
flush(char[] buf,
int upUntil) |
int |
getFlattenStart() |
boolean |
includeComments() |
boolean |
includeConditionals() |
boolean |
includeParamEntities() |
void |
output(char c) |
void |
output(java.lang.String output)
Method called when explicit output has to be done for flatten output:
this is usually done when there's need to do speculative checks
before it's known if some chars are output (when suppressing comments
or conditional sections)
|
void |
setFlattenStart(int ptr) |
final java.io.Writer mWriter
final boolean mIncludeComments
final boolean mIncludeConditionals
final boolean mIncludePEs
int mIsFlattening
int mFlattenStart
public DTDWriter(java.io.Writer out, boolean inclComments, boolean inclCond, boolean inclPEs)
public boolean includeComments()
public boolean includeConditionals()
public boolean includeParamEntities()
public void disableOutput()
public void enableOutput(int newStart)
public void setFlattenStart(int ptr)
public int getFlattenStart()
public void flush(char[] buf, int upUntil) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public void output(java.lang.String output) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public void output(char c) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException