Package com.ctc.wstx.dtd
Class DTDWriter
- java.lang.Object
-
- com.ctc.wstx.dtd.DTDWriter
-
final class DTDWriter extends java.lang.ObjectSimple utility class used byDTDReaderwhen 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
IOExceptions are generally wrapped asXMLStreamExceptions. 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.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intmFlattenStartPointer to first character in the current input buffer that has not yet been written to flatten writer.(package private) booleanmIncludeComments(package private) booleanmIncludeConditionals(package private) booleanmIncludePEs(package private) intmIsFlatteningCounter 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.WritermWriter
-
Constructor Summary
Constructors Constructor Description DTDWriter(java.io.Writer out, boolean inclComments, boolean inclCond, boolean inclPEs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisableOutput()voidenableOutput(int newStart)voidflush(char[] buf, int upUntil)intgetFlattenStart()booleanincludeComments()booleanincludeConditionals()booleanincludeParamEntities()voidoutput(char c)voidoutput(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)voidsetFlattenStart(int ptr)
-
-
-
Field Detail
-
mWriter
final java.io.Writer mWriter
-
mIncludeComments
final boolean mIncludeComments
-
mIncludeConditionals
final boolean mIncludeConditionals
-
mIncludePEs
final boolean mIncludePEs
-
mIsFlattening
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. Only enabled if mWriter is not null; will be temporarily disabled during processing of content that is not to be included (PE reference; or comments / conditional sections if comment/cs output is suppressed)
-
mFlattenStart
int mFlattenStart
Pointer to first character in the current input buffer that has not yet been written to flatten writer.
-
-
Method Detail
-
includeComments
public boolean includeComments()
-
includeConditionals
public boolean includeConditionals()
-
includeParamEntities
public boolean includeParamEntities()
-
disableOutput
public void disableOutput()
-
enableOutput
public void enableOutput(int newStart)
-
setFlattenStart
public void setFlattenStart(int ptr)
-
getFlattenStart
public int getFlattenStart()
-
flush
public void flush(char[] buf, int upUntil) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
output
public void output(java.lang.String output) throws javax.xml.stream.XMLStreamExceptionMethod 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)- Throws:
javax.xml.stream.XMLStreamException
-
output
public void output(char c) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
-