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

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


  } // helperWrite

  public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
  {
    Vector vMembers = ( (ValueEntry) entry ).state ();
    TypedefEntry member = ((InterfaceState) vMembers.elementAt (0)).entry;
    SymtabEntry mType = member.type ();

    if (mType instanceof PrimitiveEntry || !member.arrayInfo ().isEmpty ())
      index = ((JavaGenerator)member.generator ()).write (index, indent, name + ".value", member, stream);
    else if (mType instanceof SequenceEntry || mType instanceof StringEntry || mType instanceof TypedefEntry || !member.arrayInfo ().isEmpty ())
      index = ((JavaGenerator)member.generator ()).write (index, indent, name, member, stream);
    else if (mType instanceof ValueEntry || mType instanceof ValueBoxEntry)
      stream.println (indent
                      + "((org.omg.CORBA_2_3.portable.OutputStream)ostream).write_value ((java.io.Serializable) value, " // <d60929>
                      +  Util.helperName (mType, true// <d61056>
                      + ".get_instance ());"); // <d61056>
View Full Code Here


  } // writeAbstract

  protected void streamableRead (String entryName, SymtabEntry entry, PrintWriter stream)
  {
    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 ())
    {
      SymtabEntry mEntry = (SymtabEntry) ((InterfaceState) vMembers.elementAt (0)).entry;
      ((JavaGenerator)member.generator ()).read (0, "    ", entryName + ".value", member, stream);
    }
    else if (mType instanceof ValueEntry || mType instanceof ValueBoxEntry)
      stream.println ("    " + entryName + ".value = (" + Util.javaQualifiedName (mType) + ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName(mType, true) + ".get_instance ());"); // <d60929> // <d61056>
    else
      stream.println ("    " + entryName + ".value = " + Util.helperName (mType, true) + ".read (istream);"); // <d61056>
View Full Code Here

        if (passType == ParameterEntry.Inout)
        {
          if (type instanceof ValueBoxEntry)
          {
            ValueBoxEntry v = (ValueBoxEntry) type;
            TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
            SymtabEntry mType = member.type ();
            if (mType instanceof PrimitiveEntry)
              stream.println (indent + name + ".value = (" + writeInputStreamRead ("in", parm.type ()) + ").value;");
            else
              stream.println (indent + name + ".value = " + writeInputStreamRead ("in", parm.type ()) + ";");
          }
View Full Code Here

      if (parm.passType () != ParameterEntry.In)
      {
        if (parm.type () instanceof ValueBoxEntry)
        {
          ValueBoxEntry v = (ValueBoxEntry) parm.type ();
          TypedefEntry member =
              ((InterfaceState) v.state ().elementAt (0)).entry;
          SymtabEntry mType = member.type ();
          if (mType instanceof PrimitiveEntry)
            stream.println(FOUR_INDENT +  parm.name () +
                ".value = (" + writeInputStreamRead ("$in", parm.type ()) +
                ").value;");
          else
View Full Code Here

    else if (type instanceof SequenceEntry)
      stream.println (oStream + ".write_" + type.type().name() + " (" + name + ");");
    else if (type instanceof ValueBoxEntry)
    {
      ValueBoxEntry v = (ValueBoxEntry) type;
      TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
      SymtabEntry mType = member.type ();

      // if write value to the boxed holder indicated by the name ending with ".value"
      if (mType instanceof PrimitiveEntry && name.endsWith (".value"))
        stream.println (Util.helperName (type, true) + ".write (" + oStream + ", "  // <d61056>
        + " new " + Util.javaQualifiedName (type) + " (" + name + "));"); //<d60929>
View Full Code Here

    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 ();
View Full Code Here

    }

    Enumeration e = ((StructEntry)entry).members ().elements ();
    while (e.hasMoreElements ())
    {
      TypedefEntry member = (TypedefEntry)e.nextElement ();
      SymtabEntry  mType = member.type ();

      if (!member.arrayInfo ().isEmpty () || mType instanceof SequenceEntry ||
          mType instanceof PrimitiveEntry || mType instanceof StringEntry ||
          mType instanceof TypedefEntry)
        index = ((JavaGenerator)member.generator ()).read (index, indent, name + '.' + member.name (), member, stream);
      else if (mType instanceof ValueBoxEntry)
      {
        // call read_value instead of Helper.read for the value
        Vector st = ((ValueBoxEntry) mType).state ();
        TypedefEntry vbMember = ((InterfaceState) st.elementAt (0)).entry;
        SymtabEntry vbType = vbMember.type ();

        String jName = null;
        String jHelper = null;

        if (vbType instanceof SequenceEntry || vbType instanceof StringEntry ||
            !vbMember.arrayInfo ().isEmpty ())
        {
          jName = Util.javaName (vbType);      // name of mapped Java type
          // <d59437> REVISIT.  Typename info. now correct for value boxes, so
          // these two cases may be obsolete.  See UnionGen.read().
          //jHelper = Util.helperName (vbType, false);  // <d61056>
View Full Code Here

    }

    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;
  } // write
View Full Code Here

    holderClass = entry.name () + "Holder";
    helperClass = Util.helperName (entry, true); // <d61056>
    if (entry instanceof ValueBoxEntry)
    {
      ValueBoxEntry v = (ValueBoxEntry) entry;
      TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
      SymtabEntry mType =  member.type ();
      holderType = Util.javaName (mType);
    }
    else
      holderType = Util.javaName (entry);
  } // init
View Full Code Here

  {
    stream.println ("  public void _read (org.omg.CORBA.portable.InputStream i)");
    stream.println ("  {");
    if (entry instanceof ValueBoxEntry)
    {
      TypedefEntry member = ((InterfaceState) ((ValueBoxEntry) entry).state ().elementAt (0)).entry;
      SymtabEntry mType = member.type ();
      if (mType instanceof StringEntry)
        stream.println ("    value = i.read_string ();");

      else if (mType instanceof PrimitiveEntry)
        stream.println ("    value = " + helperClass + ".read (i).value;");
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.