Class Dumper

All Implemented Interfaces:
PCDataVisitor

@Undocumented public class Dumper extends Visitor
Serializes the model instance into a sequence of SAX events.
A ContentHandler MUST be given for all "substantial" events (= Document and Element Open and Close Tags, incl. Attributes; PCData; ProcessingInstructions).
A LexicalHandler MAY be given, for all TypedComment.
See the resp. SAX documentation.
The serialization process can be started by calling any visit(..) method as defined in Visitor (i.e.: for any Element or sub-content like Choice and Sequence). This will write out the whole sub-tree starting there.
(NOTE: in this case the document locator must be set manually, see the generated code for visit(Document_XXX) for details.)
  • Field Details

    • contentHandler

      protected final ContentHandler contentHandler
    • lexicalHandler

      protected final LexicalHandler lexicalHandler
    • EMPTY_ATTRIBUTES

      protected final Attributes EMPTY_ATTRIBUTES
  • Constructor Details

    • Dumper

      @Undocumented public Dumper(ContentHandler contentHandler, LexicalHandler lexicalHandler)
      Set both handlers for substantial and ethereal events, see class description above.
      Parameters:
      contentHandler - (never null) for Substantials and PIs.
      lexicalHandler - (maybe null) for Comments.
    • Dumper

      @Undocumented public Dumper(ContentHandler contentHandler)
      Uses the contentHandler also as a LexicalHandler (for TypedComment), iff it happens to implement this interface. @param contentHandler (never null) Object serving as contentHandler for substantial events, and possibly also as a LexicalHandler.
  • Method Details

    • handleSAXException

      protected void handleSAXException(SAXException exception)
    • visit

      public void visit(TypedPCData pcdata)
      Description copied from class: BaseVisitor
      To be overridden. This default implementation does nothing.
      Specified by:
      visit in interface PCDataVisitor
      Overrides:
      visit in class Visitor
    • visit

      public void visit(Element_entry element)
      Description copied from class: Visitor
      Can be overridden by the user to define particular semantic operations. Will be called whenever the default model instance traversal (as implemented by the methods in this class) reaches such an element.
      This default implementation descends into the element by calling visit(..) in turn for all selected attributes (see BaseVisitor.validating) and for all components in its contents according to the content model.
      Overrides:
      visit in class Visitor
    • visit

      public void visit(Element_translationfile element)
      Description copied from class: Visitor
      Can be overridden by the user to define particular semantic operations. Will be called whenever the default model instance traversal (as implemented by the methods in this class) reaches such an element.
      This default implementation descends into the element by calling visit(..) in turn for all components in its contents according to the content model.
      Overrides:
      visit in class Visitor
    • visit

      public void visit(Element_text element)
      Description copied from class: Visitor
      Can be overridden by the user to define particular semantic operations. Will be called whenever the default model instance traversal (as implemented by the methods in this class) reaches such an element.
      This default implementation descends into the element by calling visit(..) in turn for all selected attributes (see BaseVisitor.validating) and for all PCData in its contents.
      Overrides:
      visit in class Visitor
    • visit

      public void visit(Document_translationfile document)
      Description copied from class: Visitor
      Can be called to visit the complete model instance. (Is not intended to be overridden by the user.)
      Overrides:
      visit in class Visitor