JML

org.jmlspecs.racwrap
Class FactoryPrinter

java.lang.Object
  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
FactoryPrinter()
          Parameterless constructor.
FactoryPrinter(PrintStream out)
          Constructor.
 
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

out

public PrintStream out
Constructor Detail

FactoryPrinter

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

Parameters:
out - the PrintStream object to output the result to.

FactoryPrinter

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

Method Detail

print

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


print_class

public void print_class(JmlTypeDeclaration clazz)

printConstructor

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


JML

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.