dk.brics.servletvalidator.grammar
Class XMLPrettyPrinter

java.lang.Object
  extended by dk.brics.servletvalidator.grammar.AbstractGrammarEntityVisitor
      extended by dk.brics.servletvalidator.AbstractPrettyPrinter
          extended by dk.brics.servletvalidator.grammar.XMLPrettyPrinter
All Implemented Interfaces:
GrammarEntityVisitor, PrettyPrinter

public class XMLPrettyPrinter
extends AbstractPrettyPrinter

Pretty prints the grammar to an XML file so that parsing is not ambigious. The output language of this pretty printer corresponds to the language specified in this schema

Author:
schwarz

Field Summary
static String h
           
 
Fields inherited from class dk.brics.servletvalidator.grammar.AbstractGrammarEntityVisitor
marked
 
Constructor Summary
XMLPrettyPrinter(Grammar g)
           
 
Method Summary
 void apply(Grammar g)
           
protected  String escapeSymbol(String s)
          Escapes special symbols
 byte[] getUTF16()
           
 byte[] getUTF8()
           
 dk.brics.xact.XML getXML()
          Returns an XML representation of the grammar
 String print()
           
 
Methods inherited from class dk.brics.servletvalidator.AbstractPrettyPrinter
getEasyName, getNextName
 
Methods inherited from class dk.brics.servletvalidator.grammar.AbstractGrammarEntityVisitor
apply, apply, apply, getPath, in, in, in, isMarked, mark, out, out, out, print, shouldPrettyPrint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

h

public static final String h
See Also:
Constant Field Values
Constructor Detail

XMLPrettyPrinter

public XMLPrettyPrinter(Grammar g)
Method Detail

apply

public void apply(Grammar g)
Specified by:
apply in interface GrammarEntityVisitor
Overrides:
apply in class AbstractGrammarEntityVisitor

escapeSymbol

protected String escapeSymbol(String s)
Description copied from class: AbstractPrettyPrinter
Escapes special symbols

Overrides:
escapeSymbol in class AbstractPrettyPrinter
Returns:

getUTF16

public byte[] getUTF16()

getUTF8

public byte[] getUTF8()

getXML

public dk.brics.xact.XML getXML()
Returns an XML representation of the grammar

Returns:

print

public String print()


Copyright © 2008 Mathias Schwarz.