java.lang.Object
com.sun.tools.corba.ee.idl.toJavaPortable.ConstGen
All Implemented Interfaces:
ConstGen, Generator

public class ConstGen extends Object implements ConstGen
  • Field Details

  • Constructor Details

    • ConstGen

      public ConstGen()
      Public zero-argument constructor.
  • Method Details

    • generate

      public void generate(Hashtable symbolTable, ConstEntry c, PrintWriter s)
      Generate Java code for an IDL constant. A constant is written to a new class only when it is not a member of an interface; otherwise it written to the interface class in which it resides.
      Specified by:
      generate in interface ConstGen
    • init

      protected void init()
      Initialize members unique to this generator.
    • generateConst

      protected void generateConst()
      Generate the class defining the constant.
    • openStream

      protected void openStream()
      Open a new print stream only if the constant is not a member of an interface.
    • writeHeading

      protected void writeHeading()
      Write the heading for the class defining the constant.
    • writeBody

      protected void writeBody()
      Write the constant expression and any comment, if present.
    • writeConstExpr

      protected void writeConstExpr()
      Write the entire constant expression and any comment, if present.
    • writeConstValue

      private void writeConstValue(SymtabEntry type)
      Write the constant's value according to its type.
    • writeClosing

      protected void writeClosing()
      Generate any last words and close the class.
    • closeStream

      protected void closeStream()
      Close the print stream, causing the file to be written.