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


Java SymtabEntry类代码示例

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

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

示例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);
  }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:ModuleGen.java

示例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>
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:MethodGen.java

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

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

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

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

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

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

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

示例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;

  }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:EnumGen.java

示例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 ();
  }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:ValueBoxGen.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:Util.java

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


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