本文整理汇总了Java中com.sun.tools.corba.se.idl.SymtabEntry类的典型用法代码示例。如果您正苦于以下问题:Java SymtabEntry类的具体用法?Java SymtabEntry怎么用?Java SymtabEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SymtabEntry类属于com.sun.tools.corba.se.idl包,在下文中一共展示了SymtabEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readBranch
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
private int readBranch (int index, String indent, String name, String disName, TypedefEntry entry, PrintWriter stream)
{
SymtabEntry type = entry.type ();
Util.writeInitializer (indent, '_' + name, "", entry, stream);
if (!entry.arrayInfo ().isEmpty () ||
type instanceof SequenceEntry ||
type instanceof PrimitiveEntry ||
type instanceof StringEntry) {
index = ((JavaGenerator)entry.generator ()).read (index, indent, '_' + name, entry, stream);
} else {
stream.println (indent + '_' + name + " = " + Util.helperName (type, true) + ".read (istream);");
}
stream.print (indent + "value." + name + " (");
if( disName == "" )
stream.println("_" + name + ");");
else
stream.println(disName + ", " + "_" + name + ");");
return index;
}
示例2: writeMembers
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
/**
* <d62023> - private state maps to protected, not default
**/
protected void writeMembers ()
{
// if the value type contains no data members, a null return is expected
if (v.state () == null)
return;
for (int i = 0; i < v.state ().size (); i ++)
{
InterfaceState member = (InterfaceState) v.state ().elementAt (i);
SymtabEntry entry = (SymtabEntry) member.entry;
Util.fillInfo (entry);
if (entry.comment () != null)
entry.comment ().generate (" ", stream);
String modifier = " ";
if (member.modifier == InterfaceState.Public)
modifier = " public ";
else
modifier = " protected ";
Util.writeInitializer (modifier, entry.name (), "", entry, stream);
}
stream.println();
}
示例3: generate
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
/**
* Generate Java code for all members of an IDL module.
**/
public void generate (Hashtable symbolTable, ModuleEntry entry, PrintWriter stream)
{
// Generate the package directory
String name = Util.containerFullName( entry ) ;
Util.mkdir (name);
// Generate all of the contained types
Enumeration e = entry.contained ().elements ();
while (e.hasMoreElements ())
{
SymtabEntry element = (SymtabEntry)e.nextElement ();
if (element.emit ())
element.generate (symbolTable, stream);
}
}
示例4: writeExtract
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
/**
*
**/
private void writeExtract (String indent, String target, String source, SymtabEntry type, PrintWriter stream)
{
if (type instanceof PrimitiveEntry)
{
if (type.name ().equals ("long long"))
stream.println (indent + target + " = " + source + ".extract_longlong ();");
else if (type.name ().equals ("unsigned short"))
stream.println (indent + target + " = " + source + ".extract_ushort ();");
else if (type.name ().equals ("unsigned long"))
stream.println (indent + target + " = " + source + ".extract_ulong ();");
else if (type.name ().equals ("unsigned long long"))
stream.println (indent + target + " = " + source + ".extract_ulonglong ();");
else
stream.println (indent + target + " = " + source + ".extract_" + type.name () + " ();");
}
else if (type instanceof StringEntry)
stream.println (indent + target + " = " + source + ".extract_" + type.name () + " ();");
else
stream.println (indent + target + " = " + Util.helperName (type, true) + ".extract (" + source + ");"); // <d61056>
}
示例5: type
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) {
tcoffsets.set (entry);
StringEntry stringEntry = (StringEntry)entry;
String bound;
if (stringEntry.maxSize () == null)
bound = "0";
else
bound = Util.parseExpression (stringEntry.maxSize ());
// entry.name() is necessary to determine whether it is a
// string or wstring
stream.println (indent
+ name
+ " = org.omg.CORBA.ORB.init ().create_"
+ entry.name()
+ "_tc ("
+ bound + ");");
return index;
}
示例6: writeMembers
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
/**
*
**/
protected void writeMembers ()
{
// if the value type contains no data members, a null return is expected
if (v.state () == null)
return;
for (int i = 0; i < v.state ().size (); i ++)
{
InterfaceState member = (InterfaceState) v.state ().elementAt (i);
SymtabEntry entry = (SymtabEntry) member.entry;
Util.fillInfo (entry);
if (entry.comment () != null)
entry.comment ().generate (" ", stream);
String modifier = " ";
if (member.modifier == InterfaceState.Public)
modifier = " public ";
Util.writeInitializer (modifier, entry.name (), "", entry, stream);
}
}
示例7: generateContainedTypes
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
/**
*
**/
protected void generateContainedTypes ()
{
// Generate all of the contained types
Enumeration e = s.contained ().elements ();
while (e.hasMoreElements ())
{
SymtabEntry entry = (SymtabEntry)e.nextElement ();
// Don't generate contained entries if they are sequences.
// Sequences are unnamed and since they translate to arrays,
// no classes are generated for them, not even holders in this
// case since they cannot be accessed outside of this struct.
if (!(entry instanceof SequenceEntry))
entry.generate (symbolTable, stream);
}
}
示例8: init
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
/**
* Initialize variables unique to this generator.
**/
protected void init ()
{
helperClass = entry.name () + "Helper";
if (entry instanceof ValueBoxEntry)
{
ValueBoxEntry v = (ValueBoxEntry) entry;
TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
SymtabEntry mType = member.type ();
if (mType instanceof PrimitiveEntry)
helperType = Util.javaName (entry);
else
helperType = Util.javaName (mType);
}
else
helperType = Util.javaName (entry);
}
示例9: javaQualifiedName
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
/**
* Given a symtabEntry, return the name of this entry. This
* method does not do any conversions like javaName does.
**/
public static String javaQualifiedName (SymtabEntry entry)
{
String name = "";
if (entry instanceof PrimitiveEntry)
name = javaPrimName (entry.name ());
else if (entry instanceof StringEntry)
name = "String";
else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase"))
name = "java.io.Serializable";
else
{
SymtabEntry container = entry.container ();
if (container != null)
name = container.name ();
if (name.equals (""))
name = entry.name ();
else
name = containerFullName (entry.container ()) + '.' + entry.name ();
}
return name.replace ('/', '.');
}
示例10: checkForArrayBase
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
/**
*
**/
static private String checkForArrayBase (TypedefEntry t, Vector importTypes, Vector importList)
{
String arrays = "";
try
{
String name = (String)t.dynamicVariable (Compile.typedefInfo);
int index = name.indexOf ('[');
if (index >= 0)
{
arrays = name.substring (index);
name = name.substring (0, index);
}
// See if the base type should be added to the list.
SymtabEntry typeEntry = (SymtabEntry)symbolTable.get (name);
if (typeEntry != null && importTypes.contains (typeEntry))
addTo (importList, typeEntry.name ());
}
catch (NoSuchFieldException e)
{}
return arrays;
}
示例11: helperWrite
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
/**
* <d62023>
**/
public void helperWrite (SymtabEntry entry, PrintWriter stream)
{
stream.println (" if (!(ostream instanceof org.omg.CORBA_2_3.portable.OutputStream)) {");
stream.println (" throw new org.omg.CORBA.BAD_PARAM(); }");
stream.println (" ((org.omg.CORBA_2_3.portable.OutputStream) ostream).write_value (value, _instance);");
stream.println (" }");
stream.println ();
// done with "write", now do "write_value with real marshalling code.
stream.println (" public void write_value (org.omg.CORBA.portable.OutputStream ostream, java.io.Serializable value)");
stream.println (" {");
String entryName = Util.javaName(entry);
stream.println (" if (!(value instanceof " + entryName + ")) {");
stream.println (" throw new org.omg.CORBA.MARSHAL(); }");
stream.println (" " + entryName + " valueType = (" + entryName + ") value;");
write (0, " ", "valueType", entry, stream);
}
示例12: helperType
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream)
{
tcoffsets.set (entry);
EnumEntry enumEntry = (EnumEntry)entry;
StringBuffer emit = new StringBuffer ("new String[] { ");
Enumeration e = enumEntry.elements ().elements ();
boolean firstTime = true;
while (e.hasMoreElements ())
{
if (firstTime)
firstTime = false;
else
emit.append (", ");
emit.append ('"' + Util.stripLeadingUnderscores ((String)e.nextElement ()) + '"');
}
emit.append ("} ");
stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_enum_tc ("
+ Util.helperName (enumEntry, true) + ".id (), \"" // <54697> // <d61056>
// + "_id, \"" <54697>
+ Util.stripLeadingUnderscores (entry.name ()) + "\", "
+ new String (emit) + ");");
return index + 1;
}
示例13: writeBody
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
/**
*
**/
protected void writeBody ()
{
InterfaceState member = (InterfaceState) v.state ().elementAt (0);
SymtabEntry entry = (SymtabEntry) member.entry;
Util.fillInfo (entry);
if (entry.comment () != null)
entry.comment ().generate (" ", stream);
stream.println (" public " + Util.javaName (entry) + " value;");
stream.println (" public " + v.name () + " (" + Util.javaName (entry) + " initial)");
stream.println (" {");
stream.println (" value = initial;");
stream.println (" }");
stream.println ();
writeTruncatable (); // <d60929>
// writeStreamableMethods ();
}
示例14: checkForBounds
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
/**
* Determine the import lines for template types.
**/
static private void checkForBounds (SymtabEntry entry, Vector importTypes, Vector importList)
{
// Obtain actual type, just to be complete.
SymtabEntry entryType = entry;
while (entryType instanceof TypedefEntry)
entryType = entryType.type ();
if (entryType instanceof StringEntry && ((StringEntry)entryType).maxSize () != null)
checkForGlobalConstants (((StringEntry)entryType).maxSize ().rep (), importTypes, importList);
else
if (entryType instanceof SequenceEntry && ((SequenceEntry)entryType).maxSize () != null)
checkForGlobalConstants (((SequenceEntry)entryType).maxSize ().rep (), importTypes, importList);
}
示例15: helperRead
import com.sun.tools.corba.se.idl.SymtabEntry; //导入依赖的package包/类
/**
* <d62023>
**/
public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream)
{
// REVISIT: Abstract/Custom??
// per Simon mail 5/17/99
stream.println (" return (" + entryName + ")((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (id ());");
}