org.biomage.tools.generate_dtd
Class WriteDTDFile

java.lang.Object
  extended by org.biomage.tools.generate_dtd.WriteDTDFile

public class WriteDTDFile
extends java.lang.Object

Description: Class that is resposible for generating a DTD file for the classes represented by the list of class nodes passed into the constructor.


Nested Class Summary
static interface WriteDTDFile.CreateClassTransformer
          Description: An interface implemented by classes that take a class list and transform the members by either changing the relationships or adding or subtracting classes.
protected static class WriteDTDFile.PackageDependencies
          Description: An inner class to hold the inter and intra package dependencies.
 
Field Summary
protected static java.util.Vector topElementNames
          Description: The top level class.
protected  WriteDTDFile.CreateClassTransformer transformer
          Description: A class that implements the transformation interface.
 
Constructor Summary
WriteDTDFile(java.util.Vector classFiles, java.lang.String dtdFileName, java.lang.String outputDir, java.io.File header, java.lang.String transformClassName, org.w3c.dom.Element topElements)
          Description: Constructor for the DTD file generator.
 
Method Summary
 java.util.Vector CreateWriteFiles(java.util.Vector classFiles)
          Description: Create the write classes for each of the class files.
protected static boolean isReferencedClass(CreateFile createFile)
          Description: Utility method to verify whether class has roles or is top-level.
protected  void setTopElements(org.w3c.dom.Element topElements)
           
static java.util.Vector sortWriteFiles(java.util.Vector classFiles)
          Description: Create the write classes for each of the class files.
protected  void writeHeader(java.io.FileWriter writer, java.io.File header)
          Description: Writes the header information out to the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

topElementNames

protected static java.util.Vector topElementNames
Description: The top level class. Even though it has no roles, must not be treated the same since it has no roles because it is the top element


transformer

protected WriteDTDFile.CreateClassTransformer transformer
Description: A class that implements the transformation interface. Can be null.

Constructor Detail

WriteDTDFile

public WriteDTDFile(java.util.Vector classFiles,
                    java.lang.String dtdFileName,
                    java.lang.String outputDir,
                    java.io.File header,
                    java.lang.String transformClassName,
                    org.w3c.dom.Element topElements)
             throws java.lang.Exception
Description: Constructor for the DTD file generator.

Parameters:
classFiles: - information on the DTD Elements to write.
dtdFileName: - what to name the output file.
outputDir: - where to write the file.
header: - templete file for the dtd header information.
transformClassName: - optional name of the class to transform the classFiles.
packageOrder: - order of the packages for the MAGE-ML elemnt and order of the lists for the packages.
topElements: - classes not referenced by any other class in the model itself.

Throws:
java.lang.Exception
Method Detail

setTopElements

protected void setTopElements(org.w3c.dom.Element topElements)
                       throws java.lang.Exception
Throws:
java.lang.Exception

isReferencedClass

protected static boolean isReferencedClass(CreateFile createFile)
Description: Utility method to verify whether class has roles or is top-level.

Parameters:
createFile: - the class to check.


CreateWriteFiles

public java.util.Vector CreateWriteFiles(java.util.Vector classFiles)
                                  throws java.lang.Exception
Description: Create the write classes for each of the class files.

Parameters:
classFiles: - information on the DTD Elements to write.

Throws:
java.lang.Exception

sortWriteFiles

public static java.util.Vector sortWriteFiles(java.util.Vector classFiles)
                                       throws java.lang.Exception
Description: Create the write classes for each of the class files.

Parameters:
classFiles: - information on the DTD Elements to write.

Throws:
java.lang.Exception

writeHeader

protected void writeHeader(java.io.FileWriter writer,
                           java.io.File header)
                    throws java.lang.Exception
Description: Writes the header information out to the file.

Parameters:
writer: - FileWriter to used to write to the file.
header: - File for the header information.

Throws:
java.lang.Exception