本文整理汇总了Java中com.sun.tools.corba.se.idl.StructEntry类的典型用法代码示例。如果您正苦于以下问题:Java StructEntry类的具体用法?Java StructEntry怎么用?Java StructEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StructEntry类属于com.sun.tools.corba.se.idl包,在下文中一共展示了StructEntry类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doContainerFullName
import com.sun.tools.corba.se.idl.StructEntry; //导入依赖的package包/类
private static String doContainerFullName (SymtabEntry container)
{
String name = "";
if (container == null)
name = "";
else
{
if (container instanceof InterfaceEntry ||
container instanceof StructEntry ||
container instanceof UnionEntry)
name = container.name () + "Package";
else
name = container.name ();
if (container.container () != null &&
!container.container ().name ().equals (""))
name = doContainerFullName (container.container ()) + '/' + name;
}
return name;
}
示例2: generate
import com.sun.tools.corba.se.idl.StructEntry; //导入依赖的package包/类
/**
*
**/
public void generate (Hashtable symbolTable, StructEntry s, PrintWriter str)
{
this.symbolTable = symbolTable;
this.s = s;
//init ();
openStream ();
if (stream == null)
return;
generateHelper ();
generateHolder ();
writeHeading ();
writeBody ();
writeClosing ();
closeStream ();
generateContainedTypes ();
}
示例3: helperType
import com.sun.tools.corba.se.idl.StructEntry; //导入依赖的package包/类
public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream)
{
TCOffsets innerOffsets = new TCOffsets ();
innerOffsets.set (entry);
int offsetForStruct = innerOffsets.currentOffset ();
StructEntry s = (StructEntry)entry;
String membersName = "_members" + index++;
stream.println (indent + "org.omg.CORBA.StructMember[] " + membersName + " = new org.omg.CORBA.StructMember [" + s.members ().size () + "];");
String tcOfMembers = "_tcOf" + membersName;
stream.println (indent + "org.omg.CORBA.TypeCode " + tcOfMembers + " = null;");
for (int i = 0; i < s.members ().size (); ++i)
{
TypedefEntry member = (TypedefEntry)s.members ().elementAt (i);
String memberName = member.name ();
// Generate and assign member TypeCode to tcofMembers
index = ((JavaGenerator)member.generator ()).type (index, indent, innerOffsets, tcOfMembers, member, stream);
stream.println (indent + membersName + '[' + i + "] = new org.omg.CORBA.StructMember (");
stream.println (indent + " \"" + Util.stripLeadingUnderscores (memberName) + "\",");
stream.println (indent + " " + tcOfMembers + ',');
stream.println (indent + " null);");
int offsetSoFar = innerOffsets.currentOffset ();
innerOffsets = new TCOffsets ();
innerOffsets.set (entry);
innerOffsets.bumpCurrentOffset (offsetSoFar - offsetForStruct);
}
tcoffsets.bumpCurrentOffset (innerOffsets.currentOffset ());
// <54697>
//stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_struct_tc (id (), \"" + Util.stripLeadingUnderscores (entry.name ()) + "\", " + membersName + ");");
stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_" + (thisIsReallyAnException ? "exception" : "struct") + "_tc (" + Util.helperName (s, true) + ".id (), \"" + Util.stripLeadingUnderscores (entry.name ()) + "\", " + membersName + ");"); // <d61056>
return index;
}
示例4: write
import com.sun.tools.corba.se.idl.StructEntry; //导入依赖的package包/类
public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
if (thisIsReallyAnException)
{
stream.println (indent + "// write the repository ID");
stream.println (indent + "ostream.write_string (id ());");
}
Vector members = ((StructEntry)entry).members ();
for (int i = 0; i < members.size (); ++i)
{
TypedefEntry member = (TypedefEntry)members.elementAt (i);
SymtabEntry mType = member.type ();
if (!member.arrayInfo ().isEmpty () || mType instanceof SequenceEntry ||
mType instanceof TypedefEntry || mType instanceof PrimitiveEntry ||
mType instanceof StringEntry)
index = ((JavaGenerator)member.generator ()).write (index, " ", name + '.' + member.name (), member, stream);
// <d62023-klr> for corbaLevel 2.4 and up, use Helper.write like
// everything else
else if ((mType instanceof ValueEntry || mType instanceof ValueBoxEntry)
&& !Util.corbaLevel (2.4f, 99.0f)) { // <d62023>
stream.println (indent + "((org.omg.CORBA_2_3.portable.OutputStream)ostream).write_value ((java.io.Serializable) " // <d60929>
+ name + '.' + member.name () + ", "
+ Util.helperName (member.type (), true) // <d61056>
+ ".get_instance ());"); // <d61056>
}
else
stream.println (indent + Util.helperName (member.type (), true) + ".write (ostream, " + name + '.' + member.name () + ");"); // <d61056>
}
return index;
}
示例5: writeType
import com.sun.tools.corba.se.idl.StructEntry; //导入依赖的package包/类
/**
* Generate the typecode variable and type method.
**/
protected void writeType ()
{
boolean canRecurse = entry instanceof ValueEntry
|| entry instanceof ValueBoxEntry
|| entry instanceof StructEntry;
stream.println (" private static org.omg.CORBA.TypeCode __typeCode = null;");
if (canRecurse)
stream.println (" private static boolean __active = false;");
stream.println (" synchronized public static org.omg.CORBA.TypeCode type ()");
stream.println (" {");
stream.println (" if (__typeCode == null)");
stream.println (" {");
if (canRecurse) {
stream.println (" synchronized (org.omg.CORBA.TypeCode.class)");
stream.println (" {");
stream.println (" if (__typeCode == null)");
stream.println (" {");
stream.println (" if (__active)");
stream.println (" {");
stream.println (" return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );");
stream.println (" }");
stream.println (" __active = true;");
((JavaGenerator)entry.generator ()).helperType (0, " ", new TCOffsets (), "__typeCode", entry, stream);
}
else
((JavaGenerator)entry.generator ()).helperType (0, " ", new TCOffsets (), "__typeCode", entry, stream);
// Generate body of type() method
if (canRecurse) {
stream.println (" __active = false;");
stream.println (" }");
stream.println (" }");
}
stream.println (" }");
stream.println (" return __typeCode;");
stream.println (" }");
stream.println ();
}