Class EnumGen
- java.lang.Object
-
- com.sun.tools.corba.ee.idl.toJavaPortable.EnumGen
-
- All Implemented Interfaces:
EnumGen
,Generator
,JavaGenerator
public class EnumGen extends java.lang.Object implements EnumGen, JavaGenerator
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String
className
protected EnumEntry
e
(package private) java.lang.String
fullClassName
protected java.io.PrintWriter
stream
protected java.util.Hashtable
symbolTable
-
Constructor Summary
Constructors Constructor Description EnumGen()
Public zero-argument constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeStream()
Close the print stream, which writes the stream to file.void
generate(java.util.Hashtable symbolTable, EnumEntry e, java.io.PrintWriter s)
Generate the Java code for an IDL enumeration.protected void
generateHelper()
Generate the helper class for this enumeration.protected void
generateHolder()
Generate the holder class for this enumeration.void
helperRead(java.lang.String entryName, SymtabEntry entry, java.io.PrintWriter stream)
int
helperType(int index, java.lang.String indent, TCOffsets tcoffsets, java.lang.String name, SymtabEntry entry, java.io.PrintWriter stream)
void
helperWrite(SymtabEntry entry, java.io.PrintWriter stream)
protected void
init()
Initialize members unique to this generator.protected void
openStream()
Open the print stream to which to write the enumeration class.int
read(int index, java.lang.String indent, java.lang.String name, SymtabEntry entry, java.io.PrintWriter stream)
int
type(int index, java.lang.String indent, TCOffsets tcoffsets, java.lang.String name, SymtabEntry entry, java.io.PrintWriter stream)
int
write(int index, java.lang.String indent, java.lang.String name, SymtabEntry entry, java.io.PrintWriter stream)
protected void
writeBody()
Write the members of enumeration class.protected void
writeClosing()
Close the enumeration class.protected void
writeCtors()
Write the protected constructor for the enumeration class.protected void
writeFromInt()
Write the from_int method for the enumeration class.protected void
writeHeading()
Write the heading of the enumeration class, including the package, imports, class statement, and open curly.protected void
writeValue()
Write the value method for the enumeration class.
-
-
-
Field Detail
-
symbolTable
protected java.util.Hashtable symbolTable
-
e
protected EnumEntry e
-
stream
protected java.io.PrintWriter stream
-
className
java.lang.String className
-
fullClassName
java.lang.String fullClassName
-
-
Method Detail
-
generate
public void generate(java.util.Hashtable symbolTable, EnumEntry e, java.io.PrintWriter s)
Generate the Java code for an IDL enumeration.
-
init
protected void init()
Initialize members unique to this generator.
-
openStream
protected void openStream()
Open the print stream to which to write the enumeration class.
-
generateHolder
protected void generateHolder()
Generate the holder class for this enumeration.
-
generateHelper
protected void generateHelper()
Generate the helper class for this enumeration.
-
writeHeading
protected void writeHeading()
Write the heading of the enumeration class, including the package, imports, class statement, and open curly.
-
writeBody
protected void writeBody()
Write the members of enumeration class.
-
writeValue
protected void writeValue()
Write the value method for the enumeration class.
-
writeFromInt
protected void writeFromInt()
Write the from_int method for the enumeration class.
-
writeCtors
protected void writeCtors()
Write the protected constructor for the enumeration class.
-
writeClosing
protected void writeClosing()
Close the enumeration class.
-
closeStream
protected void closeStream()
Close the print stream, which writes the stream to file.
-
helperType
public int helperType(int index, java.lang.String indent, TCOffsets tcoffsets, java.lang.String name, SymtabEntry entry, java.io.PrintWriter stream)
- Specified by:
helperType
in interfaceJavaGenerator
-
type
public int type(int index, java.lang.String indent, TCOffsets tcoffsets, java.lang.String name, SymtabEntry entry, java.io.PrintWriter stream)
- Specified by:
type
in interfaceJavaGenerator
-
helperRead
public void helperRead(java.lang.String entryName, SymtabEntry entry, java.io.PrintWriter stream)
- Specified by:
helperRead
in interfaceJavaGenerator
-
helperWrite
public void helperWrite(SymtabEntry entry, java.io.PrintWriter stream)
- Specified by:
helperWrite
in interfaceJavaGenerator
-
read
public int read(int index, java.lang.String indent, java.lang.String name, SymtabEntry entry, java.io.PrintWriter stream)
- Specified by:
read
in interfaceJavaGenerator
-
write
public int write(int index, java.lang.String indent, java.lang.String name, SymtabEntry entry, java.io.PrintWriter stream)
- Specified by:
write
in interfaceJavaGenerator
-
-