当前位置: 首页>>代码示例>>Java>>正文


Java StructEntry类代码示例

本文整理汇总了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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:Util.java

示例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 ();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:StructGen.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:StructGen.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:StructGen.java

示例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 ();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:43,代码来源:Helper.java


注:本文中的com.sun.tools.corba.se.idl.StructEntry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。