org.kohsuke.rngom.digested
Class DXMLPrinter

java.lang.Object
  extended by org.kohsuke.rngom.digested.DXMLPrinter

public class DXMLPrinter
extends java.lang.Object

Printer of RELAX NG digested model to XML using StAX XMLStreamWriter.

Author:
Alexey Demakov

Nested Class Summary
protected  class DXMLPrinter.DXMLPrinterVisitor
           
protected  class DXMLPrinter.NameClassXMLPrinterVisitor
           
protected  class DXMLPrinter.XMLWriter
           
protected  class DXMLPrinter.XMLWriterException
           
 
Field Summary
protected  boolean afterEnd
           
protected  org.kohsuke.rngom.digested.DOMPrinter domPrinter
           
protected  int indent
           
protected  java.lang.String indentStep
           
protected  DXMLPrinter.NameClassXMLPrinterVisitor ncVisitor
           
protected  java.lang.String newLine
           
protected  XMLStreamWriter out
           
protected  DXMLPrinter.DXMLPrinterVisitor visitor
           
 
Constructor Summary
DXMLPrinter(XMLStreamWriter out)
           
 
Method Summary
static void main(java.lang.String[] args)
           
 void print(DPattern pattern)
          Prints XML fragment for the given pattern.
 void print(NameClass nc)
          Prints XML fragment for the given name class.
 void print(org.w3c.dom.Node node)
           
 void printDocument(DGrammarPattern grammar)
          Prints grammar enclosed by start/end document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected XMLStreamWriter out

indentStep

protected java.lang.String indentStep

newLine

protected java.lang.String newLine

indent

protected int indent

afterEnd

protected boolean afterEnd

visitor

protected DXMLPrinter.DXMLPrinterVisitor visitor

ncVisitor

protected DXMLPrinter.NameClassXMLPrinterVisitor ncVisitor

domPrinter

protected org.kohsuke.rngom.digested.DOMPrinter domPrinter
Constructor Detail

DXMLPrinter

public DXMLPrinter(XMLStreamWriter out)
Parameters:
out - Output stream.
Method Detail

printDocument

public void printDocument(DGrammarPattern grammar)
                   throws XMLStreamException
Prints grammar enclosed by start/end document.

Parameters:
grammar -
Throws:
XMLStreamException

print

public void print(DPattern pattern)
           throws XMLStreamException
Prints XML fragment for the given pattern.

Throws:
XMLStreamException

print

public void print(NameClass nc)
           throws XMLStreamException
Prints XML fragment for the given name class.

Throws:
XMLStreamException

print

public void print(org.w3c.dom.Node node)
           throws XMLStreamException
Throws:
XMLStreamException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception