Package com.sun.tools.corba.ee.idl
Class SymtabEntry
- java.lang.Object
-
- com.sun.tools.corba.ee.idl.SymtabEntry
-
- Direct Known Subclasses:
ConstEntry
,EnumEntry
,ForwardEntry
,IncludeEntry
,InterfaceEntry
,MethodEntry
,ModuleEntry
,NativeEntry
,ParameterEntry
,PragmaEntry
,PrimitiveEntry
,SequenceEntry
,StringEntry
,StructEntry
,TypedefEntry
,UnionEntry
public class SymtabEntry extends java.lang.Object
This is the base class for all symbol table entries.
-
-
Field Summary
Fields Modifier and Type Field Description private Comment
_comment
private SymtabEntry
_container
private java.util.Vector<java.lang.Object>
_dynamicVars
private boolean
_emit
private java.lang.Object
_info
private boolean
_isReferencable
private java.lang.String
_module
private java.lang.String
_name
private RepositoryID
_repID
private IncludeEntry
_sourceFile
private SymtabEntry
_type
private java.lang.String
_typeName
(package private) static java.util.Stack<java.lang.Boolean>
includeStack
(package private) static int
maxKey
(package private) static boolean
setEmit
-
Constructor Summary
Constructors Constructor Description SymtabEntry()
SymtabEntry(SymtabEntry that)
This is a shallow copy constructorSymtabEntry(SymtabEntry that, IDLID clone)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
This is a shallow copy cloneComment
comment()
void
comment(Comment comment)
SymtabEntry
container()
This must be either an InterfaceEntry or a ModuleEntry.void
container(SymtabEntry newContainer)
This must be either an InterfaceEntry or a ModuleEntry.java.lang.Object
dynamicVariable(int key)
Other variables besides the default ones can be dynamically placed into SymTabEntry (and therefore on all symbol table entries) by extenders.void
dynamicVariable(int key, java.lang.Object value)
Other variables besides the default ones can be dynamically placed into SymTabEntry (and therefore on all symbol table entries) by extenders.boolean
emit()
Should this type be emitted?void
emit(boolean emit)
(package private) static void
enteringInclude()
(package private) static void
exitingInclude()
java.lang.String
fullName()
void
generate(java.util.Hashtable symbolTable, java.io.PrintWriter stream)
Invoke a generator.Generator
generator()
Access a generator.static int
getVariableKey()
Other variables besides the default ones can be dynamically placed into SymTabEntry (and therefore on all symbol table entries) by extenders.(package private) void
growVars()
(package private) void
initDynamicVars()
boolean
isReferencable()
void
isReferencable(boolean value)
java.lang.String
module()
Get the name of this entry's module.void
module(java.lang.String newName)
Set the module for this entry.java.lang.String
name()
void
name(java.lang.String newName)
Set the name.RepositoryID
repositoryID()
void
repositoryID(RepositoryID id)
Set the repository ID for this entry.IncludeEntry
sourceFile()
The file name in which this entry was defined.void
sourceFile(IncludeEntry file)
The file name in which this entry was defined.SymtabEntry
type()
void
type(SymtabEntry newType)
java.lang.String
typeName()
protected void
typeName(java.lang.String typeName)
-
-
-
Field Detail
-
includeStack
static java.util.Stack<java.lang.Boolean> includeStack
-
setEmit
static boolean setEmit
-
maxKey
static int maxKey
-
_container
private SymtabEntry _container
-
_module
private java.lang.String _module
-
_name
private java.lang.String _name
-
_typeName
private java.lang.String _typeName
-
_type
private SymtabEntry _type
-
_sourceFile
private IncludeEntry _sourceFile
-
_info
private java.lang.Object _info
-
_repID
private RepositoryID _repID
-
_emit
private boolean _emit
-
_comment
private Comment _comment
-
_dynamicVars
private java.util.Vector<java.lang.Object> _dynamicVars
-
_isReferencable
private boolean _isReferencable
-
-
Constructor Detail
-
SymtabEntry
public SymtabEntry()
-
SymtabEntry
SymtabEntry(SymtabEntry that, IDLID clone)
-
SymtabEntry
SymtabEntry(SymtabEntry that)
This is a shallow copy constructor- Parameters:
that
- SymtabEntry to copy
-
-
Method Detail
-
initDynamicVars
void initDynamicVars()
-
clone
public java.lang.Object clone()
This is a shallow copy clone- Overrides:
clone
in classjava.lang.Object
-
fullName
public final java.lang.String fullName()
- Returns:
- the concatenation of the module and the name, delimited by '/'.
-
module
public java.lang.String module()
Get the name of this entry's module. If there are modules within modules, each module name is separated by '/'.- Returns:
- this entry's module name.
-
module
public void module(java.lang.String newName)
Set the module for this entry.- Parameters:
newName
- the new name of the module.
-
name
public java.lang.String name()
- Returns:
- the name of this entry.
-
name
public void name(java.lang.String newName)
Set the name.- Parameters:
newName
- the new name.
-
typeName
public java.lang.String typeName()
- Returns:
- the type name of this entry.
-
typeName
protected void typeName(java.lang.String typeName)
-
type
public SymtabEntry type()
- Returns:
- the type entry of this entry
-
type
public void type(SymtabEntry newType)
-
sourceFile
public IncludeEntry sourceFile()
The file name in which this entry was defined.- Returns:
IncludeEntry
of fileName
-
sourceFile
public void sourceFile(IncludeEntry file)
The file name in which this entry was defined.- Parameters:
file
-IncludeEntry
of the file
-
container
public SymtabEntry container()
This must be either an InterfaceEntry or a ModuleEntry. It can be nothing else.- Returns:
- container of the entry
-
container
public void container(SymtabEntry newContainer)
This must be either an InterfaceEntry or a ModuleEntry. It can be nothing else.- Parameters:
newContainer
-InterfaceEntry
orModuleEntry
-
repositoryID
public RepositoryID repositoryID()
- Returns:
- the repository ID for this entry.
-
repositoryID
public void repositoryID(RepositoryID id)
Set the repository ID for this entry.- Parameters:
id
- the new repository ID.
-
emit
public boolean emit()
Should this type be emitted?- Returns:
- true if this type is emitted and referencable
-
emit
public void emit(boolean emit)
-
comment
public Comment comment()
-
comment
public void comment(Comment comment)
-
isReferencable
public boolean isReferencable()
-
isReferencable
public void isReferencable(boolean value)
-
enteringInclude
static void enteringInclude()
-
exitingInclude
static void exitingInclude()
-
getVariableKey
public static int getVariableKey()
Other variables besides the default ones can be dynamically placed into SymTabEntry (and therefore on all symbol table entries) by extenders. Before such a variable can exist, its key must be obtained by calling getVariableKey.- Returns:
- the key for placing variables into the entry
-
dynamicVariable
public void dynamicVariable(int key, java.lang.Object value) throws java.lang.NoSuchFieldException
Other variables besides the default ones can be dynamically placed into SymTabEntry (and therefore on all symbol table entries) by extenders. This method assigns the value to the variable of the given key. A valid key must be obtained by calling the method getVariableKey. If the key is invalid, NoSuchFieldException is thrown.- Parameters:
key
- obtained bygetVariableKey()
value
- variable to assign to key- Throws:
java.lang.NoSuchFieldException
- if key is invalid
-
dynamicVariable
public java.lang.Object dynamicVariable(int key) throws java.lang.NoSuchFieldException
Other variables besides the default ones can be dynamically placed into SymTabEntry (and therefore on all symbol table entries) by extenders. This method gets the value of the variable of the given key. A valid key must be obtained by calling the method getVariableKey. If the key is invalid,NoSuchFieldException
is thrown.- Parameters:
key
- obtained by callinggetVariableKey()
- Returns:
- the variable for the key
- Throws:
java.lang.NoSuchFieldException
- if key is invalid
-
growVars
void growVars()
-
generate
public void generate(java.util.Hashtable symbolTable, java.io.PrintWriter stream)
Invoke a generator. A call to this method is only meaningful for subclasses of SymtabEntry. If called on this class, it is a no-op.- Parameters:
symbolTable
- the symbol table is a hash table whose key is a fully qualified type name and whose value is a SymtabEntry or a subclass of SymtabEntry.stream
- the stream to which the generator should sent its output.
-
generator
public Generator generator()
Access a generator. A call to this method is only meaningful for subclasses of SymtabEntry. If called on this class, it is a no-op.- Returns:
- an object which implements the Generator interface.
-
-