Class FactoryPrinter

  extended byorg.jmlspecs.racwrap.FactoryPrinter

public class FactoryPrinter
extends Object

The InterfacePrinter is an object that is used to output the interface definition of a class to a file, given an abstract syntax tree. This class extends JMLAbstractVisitor, so we only need to implement the parts that we need.

Field Summary
 PrintStream out
Constructor Summary
          Parameterless constructor.
FactoryPrinter(PrintStream out)
Method Summary
 void print(JmlCompilationUnit compileUnit)
          Prints the factory methods for a class.
 void print_class(JmlTypeDeclaration clazz)
 void printConstructor(JmlTypeDeclaration clazz, JMethodDeclarationType method)
          This prints out the factory method that corresponds to a constructor in the original object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public PrintStream out
Constructor Detail


public FactoryPrinter(PrintStream out)
Constructor. Initialize a new factory printer.

out - the PrintStream object to output the result to.


public FactoryPrinter()
Parameterless constructor. Defaults to having out as System.out

Method Detail


public void print(JmlCompilationUnit compileUnit)
Prints the factory methods for a class. This generates a $chx_Statics_xxx class with a factory method for every constructor. Also, this wraps the static methods of the original class. This is limited to: files with only one toplevel class


public void print_class(JmlTypeDeclaration clazz)


public void printConstructor(JmlTypeDeclaration clazz,
                             JMethodDeclarationType method)
This prints out the factory method that corresponds to a constructor in the original object.


JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.