Class DTDWriter

java.lang.Object
com.ctc.wstx.dtd.DTDWriter

final class DTDWriter extends Object
Simple utility class used by
invalid reference
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 IOExceptions are generally wrapped as XMLStreamExceptions. 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 Details

    • mWriter

      final 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.
  • Constructor Details

    • DTDWriter

      public DTDWriter(Writer out, boolean inclComments, boolean inclCond, boolean inclPEs)
  • Method Details

    • 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 XMLStreamException
      Throws:
      XMLStreamException
    • output

      public void output(String output) throws XMLStreamException
      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)
      Throws:
      XMLStreamException
    • output

      public void output(char c) throws XMLStreamException
      Throws:
      XMLStreamException