DTD2Java API

ch.perseguers.xml.dtd.util
Class JJGenerator

java.lang.Object
  extended bych.perseguers.xml.dtd.util.JJGenerator
All Implemented Interfaces:
UtilConstants

public class JJGenerator
extends java.lang.Object
implements UtilConstants


Field Summary
 java.util.Hashtable matchAllMethods
           
 java.util.Hashtable matchClassName
           
 java.util.TreeMap matchTokens
           
 
Fields inherited from interface ch.perseguers.xml.dtd.util.UtilConstants
CLASS_PREFIX_NAME, DTD2JAVA_RESERVED, FILE_SEP, JAVA_15_RESERVED, JAVA_RESERVED, MATCH_PREFIX_METHOD_NAME, MULT_CLASS_ONE, MULT_CLASS_ZERO_ONE, MULT_ONE_VECTOR, MULT_VECTOR, RESERVED_WORDS, TAB, TAB2, TAB3, TAB4, TAB5, TAB6
 
Constructor Summary
JJGenerator()
          Constructor, setting package name to , output directory and outputFileName to uninitialized.
 
Method Summary
 void generate()
          Generate the JavaCC Grammar matching XML documents corresponding to a given DTD.
 DTDdocument getDocument()
          Return the DTD document.
 Element getRootElement()
          Find and returns the element at the root of the current DTD document.
 void prepare(java.io.Reader dtdReader)
          Prepare the JavaCC Grammar generation by reading the DTD and preparing internal variable states.
 void setOutputDirectory(java.lang.String outputDirectory)
          Set the output directory for the JavaCC generated file.
 void setOutputFileName(java.lang.String outputFileName)
          Set the name of the output file.
 void setPackageName(java.lang.String packageName)
          Set the name of the package to use for the class.
 void setParserClass(java.lang.String parserClass)
          Set the name of the parser class for the JavaCC generated file.
 void setVerbose(boolean mode)
          Activate or Deactivate the verbose mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

matchClassName

public java.util.Hashtable matchClassName

matchAllMethods

public java.util.Hashtable matchAllMethods

matchTokens

public java.util.TreeMap matchTokens
Constructor Detail

JJGenerator

public JJGenerator()
Constructor, setting package name to , output directory and outputFileName to uninitialized. Verbose is deactivated.

Method Detail

setVerbose

public void setVerbose(boolean mode)
Activate or Deactivate the verbose mode.

Parameters:
mode - activates verbose
deactivates verbose

setPackageName

public void setPackageName(java.lang.String packageName)
Set the name of the package to use for the class.

Parameters:
packageName - Name of the package

setOutputDirectory

public void setOutputDirectory(java.lang.String outputDirectory)
Set the output directory for the JavaCC generated file.

Parameters:
outputDirectory - Name of the directory

setParserClass

public void setParserClass(java.lang.String parserClass)
Set the name of the parser class for the JavaCC generated file.

Parameters:
parserClass - Name of the parser class

setOutputFileName

public void setOutputFileName(java.lang.String outputFileName)
Set the name of the output file.

Parameters:
outputFileName - Output FileName (no directory information)

getDocument

public DTDdocument getDocument()
Return the DTD document.

Returns:
the DTD document.

getRootElement

public Element getRootElement()
Find and returns the element at the root of the current DTD document.

Returns:
the element at the root of the document.

prepare

public void prepare(java.io.Reader dtdReader)
             throws ParseException,
                    DTDException
Prepare the JavaCC Grammar generation by reading the DTD and preparing internal variable states.

Parameters:
dtdReader - Reader for the DTD input stream
Throws:
ParseException
DTDException

generate

public void generate()
              throws java.io.IOException
Generate the JavaCC Grammar matching XML documents corresponding to a given DTD.

Throws:
java.io.IOException

DTD2Java API

Copyright © 2003-2004 - Perseguers Software Services perseguers.ch