Package com.sun.tools.corba.se.idl

Examples of com.sun.tools.corba.se.idl.TypedefEntry


    Vector vMembers = ((ValueEntry) entry ).state ();
    int noOfMembers = vMembers == null ? 0 : vMembers.size ();
    for (int k = 0; k < noOfMembers; k++)
    {
      TypedefEntry member = (TypedefEntry)((InterfaceState)vMembers.elementAt (k)).entry;
      String memberName = member.name ();
      SymtabEntry mType = member.type ();

      if (mType instanceof PrimitiveEntry ||
          mType instanceof TypedefEntry   ||
          mType instanceof SequenceEntry  ||
          mType instanceof StringEntry    ||
          !member.arrayInfo ().isEmpty ())
        index = ((JavaGenerator)member.generator ()).write (index, indent, name + '.' + memberName, member, stream);
      else
        stream.println (indent + Util.helperName (mType, true) + // <d61056>
                              ".write (ostream, " + name + '.' + memberName + ");");
    }
View Full Code Here


    else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase"))
        name = "java.io.Serializable";
    else if (entry instanceof ValueBoxEntry)
    {
      ValueBoxEntry v = (ValueBoxEntry) entry;
      TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
      SymtabEntry mType = member.type ();
      if (mType instanceof PrimitiveEntry)
      {
         name = containerFullName (entry.container ());
         if (!name.equals (""))
           name = name + '.';
View Full Code Here

        name = "org.omg.CORBA.PrincipalHolder";
      else
        name = "org.omg.CORBA." + capitalize (javaQualifiedName (entry)) + "Holder";
    else if (entry instanceof TypedefEntry)
    {
      TypedefEntry td = (TypedefEntry)entry;
      if (!td.arrayInfo ().isEmpty () || td.type () instanceof SequenceEntry)
        name = javaQualifiedName (entry) + "Holder";
      else
        name = holderName (entry.type ());
    }
    else if (entry instanceof StringEntry)
View Full Code Here

        checkForBounds (member, importTypes, importList);
      }
    }
    else if (entry instanceof TypedefEntry)
    {
      TypedefEntry t = (TypedefEntry)entry;
      String arrays = checkForArrayBase (t, importTypes, importList);
      if (type == HelperFile)
      {
        checkForArrayDimensions (arrays, importTypes, importList);
        try
        {
          String name = (String)t.dynamicVariable (Compile.typedefInfo);
          int index = name.indexOf ('[');
          if (index >= 0)
            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 () + "Helper");
        }
        catch (NoSuchFieldException e)
        {}

        // <d42256> Typedefs for global bounded strings need import
        // statement when bound expression contains non-literal constants.
        checkForBounds (typeOf (t), importTypes, importList);
      }
      Vector subImportList = addImportLines (t.type (), importTypes, type);
      Enumeration e = subImportList.elements ();
      while (e.hasMoreElements ())
        addTo (importList, (String)e.nextElement ());
    }
    else if (entry instanceof UnionEntry)
    {
      UnionEntry u = (UnionEntry)entry;

      // Look at the discriminant type
      SymtabEntry utype = typeOf (u.type ());
      if (utype instanceof EnumEntry && importTypes.contains (utype))
        addTo (importList, utype.name ());

      // Look through the branches
      Enumeration branches = u.branches ().elements ();
      while (branches.hasMoreElements ())
      {
        UnionBranch branch = (UnionBranch)branches.nextElement ();
        SymtabEntry branchEntry = typeOf (branch.typedef);
        if (importTypes.contains (branchEntry))
        {
          addTo (importList, branchEntry.name ());
          if (type == HelperFile)
            addTo (importList, branchEntry.name () + "Helper");
        }
        checkForArrays (branchEntry, importTypes, importList);
        // <d42256>
        checkForBounds (branchEntry, importTypes, importList);
      }
    }

    // If a typedef is not a sequence or an array, only holders and
    // helpers are generated for it.  Remove references to such
    // class names.
    Enumeration en = importList.elements ();
    while (en.hasMoreElements ())
    {
      String name = (String)en.nextElement ();
      SymtabEntry e = (SymtabEntry)symbolTable.get (name);
      if (e != null && e instanceof TypedefEntry)
      {
        TypedefEntry t = (TypedefEntry)e;
        if (t.arrayInfo ().size () == 0 || !(t.type () instanceof SequenceEntry))
          importList.removeElement (name);
      }
    }
    return importList;
  } // addImportLines
View Full Code Here

   **/
  static private void checkForArrays (SymtabEntry entry, Vector importTypes, Vector importList)
  {
    if (entry instanceof TypedefEntry)
    {
      TypedefEntry t = (TypedefEntry)entry;
      String arrays = checkForArrayBase (t, importTypes, importList);
      checkForArrayDimensions (arrays, importTypes, importList);
    }
  } // checkForArrays
View Full Code Here

   **/
  public static void writeInitializer (String indent, String name, String arrayDcl, SymtabEntry entry, PrintWriter stream)
  {
    if (entry instanceof TypedefEntry)
    {
      TypedefEntry td = (TypedefEntry)entry;
      writeInitializer (indent, name, arrayDcl + sansArrayInfo (td.arrayInfo ()), td.type (), stream);
    }
    else if (entry instanceof SequenceEntry)
      writeInitializer (indent, name, arrayDcl + "[]", entry.type (), stream);
    else if (entry instanceof EnumEntry)
      if (arrayDcl.length () > 0)
View Full Code Here

   **/
  public static void writeInitializer (String indent, String name, String arrayDcl, SymtabEntry entry, String initializer, PrintWriter stream)
  {
    if (entry instanceof TypedefEntry)
    {
      TypedefEntry td = (TypedefEntry)entry;
      writeInitializer (indent, name, arrayDcl + sansArrayInfo (td.arrayInfo ()), td.type (), initializer, stream);
    }
    else if (entry instanceof SequenceEntry)
      writeInitializer (indent, name, arrayDcl + "[]", entry.type (), initializer, stream);
    else if (entry instanceof EnumEntry)
      if (arrayDcl.length () > 0)
View Full Code Here

  public void generate (Hashtable symbolTable, ValueBoxEntry v, PrintWriter str)
  {
    this.symbolTable = symbolTable;
    this.v = v;

    TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
    SymtabEntry mType = member.type ();
    // if it's primitive type, generate a java class
    if (mType instanceof PrimitiveEntry)
    {
      openStream ();
      if (stream == null)
View Full Code Here

  // From JavaGenerator

  public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream)
  {
    ValueEntry vt = (ValueEntry) entry;
    TypedefEntry member = (TypedefEntry) ((InterfaceState) (vt.state ()).elementAt (0)).entry;
    SymtabEntry mType = Util.typeOf (member);
    index = ((JavaGenerator)mType.generator ()).type (index, indent, tcoffsets, name, mType, stream);
    stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_value_box_tc ("
      + "_id, "
      + '"' + entry.name () + "\", "
View Full Code Here

    stream.println ("  {");
    // end of <d59418> changes

    String indent = "    ";
    Vector vMembers = ((ValueBoxEntry) entry).state ();
    TypedefEntry member = ((InterfaceState) vMembers.elementAt (0)).entry;
    SymtabEntry mType = member.type ();
    if (mType instanceof PrimitiveEntry ||
        mType instanceof SequenceEntry ||
        mType instanceof TypedefEntry ||
        mType instanceof StringEntry ||
        !member.arrayInfo ().isEmpty ()) {
      stream.println (indent + Util.javaName (mType) + " tmp;"); // <d62023>
      ((JavaGenerator)member.generator ()).read (0, indent, "tmp", member, stream);
    }
    else if (mType instanceof ValueEntry || mType instanceof ValueBoxEntry)
      stream.println (indent + Util.javaQualifiedName (mType) + " tmp = (" +
                      Util.javaQualifiedName (mType) + ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName (mType, true) + ".get_instance ());"); // <d60929> // <d61056>
    else
View Full Code Here

TOP

Related Classes of com.sun.tools.corba.se.idl.TypedefEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.