Java Code Examples for com.sun.tools.corba.se.idl.TypedefEntry#name()

The following examples show how to use com.sun.tools.corba.se.idl.TypedefEntry#name() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ValueGen24.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <d62023> Call super._write()
 **/
public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry)entry).derivedFrom ();
  if (vParents != null && vParents.size () != 0)
  {
    ValueEntry parent = (ValueEntry)vParents.elementAt (0);
    if (parent == null)
      return index;
    // call super._read if non-abstract value parent
    if ((!parent.isAbstract ()) && (! Util.javaQualifiedName(parent).equals ("java.io.Serializable"))) // <d60929>
        stream.println(indent + "super._write (ostream);");
  }

  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 + ");");
  }

  return index;
}
 
Example 2
Source File: ValueGen.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry)entry).derivedFrom ();
  if (vParents != null && vParents.size () != 0)
  {
    ValueEntry parent = (ValueEntry)vParents.elementAt (0);
    if (parent == null)
      return index;
    // Per Simon, 4/06/99 - call parent write. <d60929>
    // Per Simon, 4/27/99 - call parent _write. <d62062>
    if (! Util.javaQualifiedName(parent).equals ("java.io.Serializable")) // <d60929>
        stream.println(indent + Util.helperName (parent, true) + "._write (ostream, value);"); // <d60929> <d61056> <d62062>
  }

  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 + ");");
  }

  return index;
}
 
Example 3
Source File: StructGen.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 4
Source File: StructGen.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 5
Source File: ValueGen.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry)entry).derivedFrom ();
  if (vParents != null && vParents.size () != 0)
  {
    ValueEntry parent = (ValueEntry)vParents.elementAt (0);
    if (parent == null)
      return index;
    // Per Simon, 4/06/99 - call parent write. <d60929>
    // Per Simon, 4/27/99 - call parent _write. <d62062>
    if (! Util.javaQualifiedName(parent).equals ("java.io.Serializable")) // <d60929>
        stream.println(indent + Util.helperName (parent, true) + "._write (ostream, value);"); // <d60929> <d61056> <d62062>
  }

  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 + ");");
  }

  return index;
}
 
Example 6
Source File: ValueGen24.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <d62023> Call super._write()
 **/
public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry)entry).derivedFrom ();
  if (vParents != null && vParents.size () != 0)
  {
    ValueEntry parent = (ValueEntry)vParents.elementAt (0);
    if (parent == null)
      return index;
    // call super._read if non-abstract value parent
    if ((!parent.isAbstract ()) && (! Util.javaQualifiedName(parent).equals ("java.io.Serializable"))) // <d60929>
        stream.println(indent + "super._write (ostream);");
  }

  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 + ");");
  }

  return index;
}
 
Example 7
Source File: ValueGen24.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <d62023> Call super._read()
 **/
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry) entry).derivedFrom ();
  if (vParents != null && vParents.size() != 0)
  {
    ValueEntry parent = (ValueEntry) vParents.elementAt (0);
    if (parent == null)
      return index;

    // call super._read if non-abstract value parent
    if ((!parent.isAbstract ()) && (! Util.javaQualifiedName(parent).equals ("java.io.Serializable"))) // <d60929>
        stream.println(indent + "super._read (istream);");
  }

  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 ()).read (index, indent, name + '.' + memberName, member, stream);
    else
      stream.println (indent + name + '.' + memberName + " = " +
                      Util.helperName (mType, true) + ".read (istream);"); // <d61056>
  }

  return index;
}
 
Example 8
Source File: StructGen.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 9
Source File: ValueGen24.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <d62023> Call super._read()
 **/
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry) entry).derivedFrom ();
  if (vParents != null && vParents.size() != 0)
  {
    ValueEntry parent = (ValueEntry) vParents.elementAt (0);
    if (parent == null)
      return index;

    // call super._read if non-abstract value parent
    if ((!parent.isAbstract ()) && (! Util.javaQualifiedName(parent).equals ("java.io.Serializable"))) // <d60929>
        stream.println(indent + "super._read (istream);");
  }

  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 ()).read (index, indent, name + '.' + memberName, member, stream);
    else
      stream.println (indent + name + '.' + memberName + " = " +
                      Util.helperName (mType, true) + ".read (istream);"); // <d61056>
  }

  return index;
}
 
Example 10
Source File: StructGen.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 11
Source File: ValueGen.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry)entry).derivedFrom ();
  if (vParents != null && vParents.size () != 0)
  {
    ValueEntry parent = (ValueEntry)vParents.elementAt (0);
    if (parent == null)
      return index;
    // Per Simon, 4/06/99 - call parent write. <d60929>
    // Per Simon, 4/27/99 - call parent _write. <d62062>
    if (! Util.javaQualifiedName(parent).equals ("java.io.Serializable")) // <d60929>
        stream.println(indent + Util.helperName (parent, true) + "._write (ostream, value);"); // <d60929> <d61056> <d62062>
  }

  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 + ");");
  }

  return index;
}
 
Example 12
Source File: ValueGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry)entry).derivedFrom ();
  if (vParents != null && vParents.size () != 0)
  {
    ValueEntry parent = (ValueEntry)vParents.elementAt (0);
    if (parent == null)
      return index;
    // Per Simon, 4/06/99 - call parent write. <d60929>
    // Per Simon, 4/27/99 - call parent _write. <d62062>
    if (! Util.javaQualifiedName(parent).equals ("java.io.Serializable")) // <d60929>
        stream.println(indent + Util.helperName (parent, true) + "._write (ostream, value);"); // <d60929> <d61056> <d62062>
  }

  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 + ");");
  }

  return index;
}
 
Example 13
Source File: ValueGen.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry)entry).derivedFrom ();
  if (vParents != null && vParents.size () != 0)
  {
    ValueEntry parent = (ValueEntry)vParents.elementAt (0);
    if (parent == null)
      return index;
    // Per Simon, 4/06/99 - call parent write. <d60929>
    // Per Simon, 4/27/99 - call parent _write. <d62062>
    if (! Util.javaQualifiedName(parent).equals ("java.io.Serializable")) // <d60929>
        stream.println(indent + Util.helperName (parent, true) + "._write (ostream, value);"); // <d60929> <d61056> <d62062>
  }

  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 + ");");
  }

  return index;
}
 
Example 14
Source File: ValueGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry) entry).derivedFrom ();
  if (vParents != null && vParents.size() != 0)
  {
    ValueEntry parent = (ValueEntry) vParents.elementAt (0);
    if (parent == null)
      return index;
    // Per Simon, 4/6/99 - call parent read. <d60929>
    if (! Util.javaQualifiedName(parent).equals ("java.io.Serializable")) // <d60929>
        stream.println(indent + Util.helperName (parent, true) + ".read (istream, value);"); // <d60929> // <d61056>
  }

  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 ()).read (index, indent, name + '.' + memberName, member, stream);
    else if (mType instanceof ValueEntry)
    {
      String returnType = Util.javaQualifiedName (mType);
      if (mType instanceof ValueBoxEntry)
        // <f46082.51> Remove -stateful.
        //returnType = Util.javaStatefulName (mType);
        returnType = Util.javaName (mType);
      stream.println ("    " + name + '.' + memberName + " = (" + returnType +
                      ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName (mType, true) +  // <d61056>
                      ".get_instance ());"); // <d61056>
    }
    else
      stream.println (indent + name + '.' + memberName + " = " +
                      Util.helperName (mType, true) + ".read (istream);"); // <d61056>
  }

  return index;
}
 
Example 15
Source File: TypedefGen.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  TypedefEntry td = (TypedefEntry)entry;
  String modifier = Util.arrayInfo (td.arrayInfo ());
  if (!modifier.equals (""))
  {
    // arrayInfo is a vector of Expressions which indicate the
    // number of array dimensions for this typedef.  But what if
    // this is a typedef of a sequence?
    // The `new' statement being generated must know the full
    // number of brackets.  That can be found in td.info.
    // For instance:
    // typedef sequence<short> A[10][10];
    // void proc (out A a);
    // typeModifier = "[10][10]"
    // td.info    = "short[][][]";
    // The first new statement generated is:
    // a.value = new short[10][][];
    // Note that the 3 sets of brackets come from td.info, not
    // arrayInfo;
    // The second new statement generated is:
    // a.value[_i1] = new short[10][];
    // ------------     ---- ------
    //    \           \    \
    //    name      baseName   arrayDcl
    int closingBrackets = 0;
    String loopIndex = "";
    String baseName;
    try
    {
      baseName = (String)td.dynamicVariable (Compile.typedefInfo);
    }
    catch (NoSuchFieldException e)
    {
      baseName = td.name ();
    }
    int startArray = baseName.indexOf ('[');
    String arrayDcl = Util.sansArrayInfo (baseName.substring (startArray)) + "[]"; // Add an extra set because the first gets stripped off in the loop.
    baseName = baseName.substring (0, startArray);

    // For interfaces having state, e.g., valuetypes.
    SymtabEntry baseEntry = (SymtabEntry)Util.symbolTable.get (baseName.replace ('.', '/'));
    if (baseEntry instanceof InterfaceEntry && ((InterfaceEntry)baseEntry).state () != null)
      // <f46082.51> Remove -stateful feature; javaStatefulName() obsolete.
      //baseName = Util.javaStatefulName ((InterfaceEntry)baseEntry);
      baseName = Util.javaName ((InterfaceEntry)baseEntry);

    int end1stArray;
    while (!modifier.equals (""))
    {
      int rbracket = modifier.indexOf (']');
      String size = modifier.substring (1, rbracket);
      end1stArray = arrayDcl.indexOf (']');
      arrayDcl = '[' + size + arrayDcl.substring (end1stArray + 2);
      stream.println (indent + name + " = new " + baseName + arrayDcl + ';');
      loopIndex = "_o" + index++;
      stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < (" + size + "); ++" + loopIndex + ')');
      stream.println (indent + '{');
      ++closingBrackets;
      modifier = modifier.substring (rbracket + 1);
      indent = indent + "  ";
      name = name + '[' + loopIndex + ']';
    }
    end1stArray = arrayDcl.indexOf (']');
    if (td.type () instanceof SequenceEntry || td.type () instanceof PrimitiveEntry || td.type () instanceof StringEntry)
      index = ((JavaGenerator)td.type ().generator ()).read (index, indent, name, td.type (), stream);
    else if (td.type () instanceof InterfaceEntry && td.type ().fullName ().equals ("org/omg/CORBA/Object"))
      stream.println (indent + name + " = istream.read_Object ();");
    else
      stream.println (indent + name + " = " + Util.helperName (td.type (), true) + ".read (istream);"); // <d61056>
    for (int i = 0; i < closingBrackets; ++i)
    {
      indent = indent.substring (2);
      stream.println (indent + '}');
    }
  }
  else
  {
    SymtabEntry tdtype = Util.typeOf (td.type ());
    if (tdtype instanceof SequenceEntry || tdtype instanceof PrimitiveEntry || tdtype instanceof StringEntry)
      index = ((JavaGenerator)tdtype.generator ()).read (index, indent, name, tdtype, stream);
    else if (tdtype instanceof InterfaceEntry && tdtype.fullName ().equals ("org/omg/CORBA/Object"))
      stream.println (indent + name + " = istream.read_Object ();");
    else
      stream.println (indent + name + " = " + Util.helperName (tdtype, true) + ".read (istream);"); // <d61056>
  }
  return index;
}
 
Example 16
Source File: TypedefGen.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  TypedefEntry td = (TypedefEntry)entry;
  String modifier = Util.arrayInfo (td.arrayInfo ());
  if (!modifier.equals (""))
  {
    // arrayInfo is a vector of Expressions which indicate the
    // number of array dimensions for this typedef.  But what if
    // this is a typedef of a sequence?
    // The `new' statement being generated must know the full
    // number of brackets.  That can be found in td.info.
    // For instance:
    // typedef sequence<short> A[10][10];
    // void proc (out A a);
    // typeModifier = "[10][10]"
    // td.info    = "short[][][]";
    // The first new statement generated is:
    // a.value = new short[10][][];
    // Note that the 3 sets of brackets come from td.info, not
    // arrayInfo;
    // The second new statement generated is:
    // a.value[_i1] = new short[10][];
    // ------------     ---- ------
    //    \           \    \
    //    name      baseName   arrayDcl
    int closingBrackets = 0;
    String loopIndex = "";
    String baseName;
    try
    {
      baseName = (String)td.dynamicVariable (Compile.typedefInfo);
    }
    catch (NoSuchFieldException e)
    {
      baseName = td.name ();
    }
    int startArray = baseName.indexOf ('[');
    String arrayDcl = Util.sansArrayInfo (baseName.substring (startArray)) + "[]"; // Add an extra set because the first gets stripped off in the loop.
    baseName = baseName.substring (0, startArray);

    // For interfaces having state, e.g., valuetypes.
    SymtabEntry baseEntry = (SymtabEntry)Util.symbolTable.get (baseName.replace ('.', '/'));
    if (baseEntry instanceof InterfaceEntry && ((InterfaceEntry)baseEntry).state () != null)
      // <f46082.51> Remove -stateful feature; javaStatefulName() obsolete.
      //baseName = Util.javaStatefulName ((InterfaceEntry)baseEntry);
      baseName = Util.javaName ((InterfaceEntry)baseEntry);

    int end1stArray;
    while (!modifier.equals (""))
    {
      int rbracket = modifier.indexOf (']');
      String size = modifier.substring (1, rbracket);
      end1stArray = arrayDcl.indexOf (']');
      arrayDcl = '[' + size + arrayDcl.substring (end1stArray + 2);
      stream.println (indent + name + " = new " + baseName + arrayDcl + ';');
      loopIndex = "_o" + index++;
      stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < (" + size + "); ++" + loopIndex + ')');
      stream.println (indent + '{');
      ++closingBrackets;
      modifier = modifier.substring (rbracket + 1);
      indent = indent + "  ";
      name = name + '[' + loopIndex + ']';
    }
    end1stArray = arrayDcl.indexOf (']');
    if (td.type () instanceof SequenceEntry || td.type () instanceof PrimitiveEntry || td.type () instanceof StringEntry)
      index = ((JavaGenerator)td.type ().generator ()).read (index, indent, name, td.type (), stream);
    else if (td.type () instanceof InterfaceEntry && td.type ().fullName ().equals ("org/omg/CORBA/Object"))
      stream.println (indent + name + " = istream.read_Object ();");
    else
      stream.println (indent + name + " = " + Util.helperName (td.type (), true) + ".read (istream);"); // <d61056>
    for (int i = 0; i < closingBrackets; ++i)
    {
      indent = indent.substring (2);
      stream.println (indent + '}');
    }
  }
  else
  {
    SymtabEntry tdtype = Util.typeOf (td.type ());
    if (tdtype instanceof SequenceEntry || tdtype instanceof PrimitiveEntry || tdtype instanceof StringEntry)
      index = ((JavaGenerator)tdtype.generator ()).read (index, indent, name, tdtype, stream);
    else if (tdtype instanceof InterfaceEntry && tdtype.fullName ().equals ("org/omg/CORBA/Object"))
      stream.println (indent + name + " = istream.read_Object ();");
    else
      stream.println (indent + name + " = " + Util.helperName (tdtype, true) + ".read (istream);"); // <d61056>
  }
  return index;
}
 
Example 17
Source File: ValueGen.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry) entry).derivedFrom ();
  if (vParents != null && vParents.size() != 0)
  {
    ValueEntry parent = (ValueEntry) vParents.elementAt (0);
    if (parent == null)
      return index;
    // Per Simon, 4/6/99 - call parent read. <d60929>
    if (! Util.javaQualifiedName(parent).equals ("java.io.Serializable")) // <d60929>
        stream.println(indent + Util.helperName (parent, true) + ".read (istream, value);"); // <d60929> // <d61056>
  }

  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 ()).read (index, indent, name + '.' + memberName, member, stream);
    else if (mType instanceof ValueEntry)
    {
      String returnType = Util.javaQualifiedName (mType);
      if (mType instanceof ValueBoxEntry)
        // <f46082.51> Remove -stateful.
        //returnType = Util.javaStatefulName (mType);
        returnType = Util.javaName (mType);
      stream.println ("    " + name + '.' + memberName + " = (" + returnType +
                      ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName (mType, true) +  // <d61056>
                      ".get_instance ());"); // <d61056>
    }
    else
      stream.println (indent + name + '.' + memberName + " = " +
                      Util.helperName (mType, true) + ".read (istream);"); // <d61056>
  }

  return index;
}
 
Example 18
Source File: ValueGen.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry) entry).derivedFrom ();
  if (vParents != null && vParents.size() != 0)
  {
    ValueEntry parent = (ValueEntry) vParents.elementAt (0);
    if (parent == null)
      return index;
    // Per Simon, 4/6/99 - call parent read. <d60929>
    if (! Util.javaQualifiedName(parent).equals ("java.io.Serializable")) // <d60929>
        stream.println(indent + Util.helperName (parent, true) + ".read (istream, value);"); // <d60929> // <d61056>
  }

  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 ()).read (index, indent, name + '.' + memberName, member, stream);
    else if (mType instanceof ValueEntry)
    {
      String returnType = Util.javaQualifiedName (mType);
      if (mType instanceof ValueBoxEntry)
        // <f46082.51> Remove -stateful.
        //returnType = Util.javaStatefulName (mType);
        returnType = Util.javaName (mType);
      stream.println ("    " + name + '.' + memberName + " = (" + returnType +
                      ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName (mType, true) +  // <d61056>
                      ".get_instance ());"); // <d61056>
    }
    else
      stream.println (indent + name + '.' + memberName + " = " +
                      Util.helperName (mType, true) + ".read (istream);"); // <d61056>
  }

  return index;
}
 
Example 19
Source File: ValueGen.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  // First do the state members from concrete parent hierarchy
  Vector vParents = ((ValueEntry) entry).derivedFrom ();
  if (vParents != null && vParents.size() != 0)
  {
    ValueEntry parent = (ValueEntry) vParents.elementAt (0);
    if (parent == null)
      return index;
    // Per Simon, 4/6/99 - call parent read. <d60929>
    if (! Util.javaQualifiedName(parent).equals ("java.io.Serializable")) // <d60929>
        stream.println(indent + Util.helperName (parent, true) + ".read (istream, value);"); // <d60929> // <d61056>
  }

  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 ()).read (index, indent, name + '.' + memberName, member, stream);
    else if (mType instanceof ValueEntry)
    {
      String returnType = Util.javaQualifiedName (mType);
      if (mType instanceof ValueBoxEntry)
        // <f46082.51> Remove -stateful.
        //returnType = Util.javaStatefulName (mType);
        returnType = Util.javaName (mType);
      stream.println ("    " + name + '.' + memberName + " = (" + returnType +
                      ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName (mType, true) +  // <d61056>
                      ".get_instance ());"); // <d61056>
    }
    else
      stream.println (indent + name + '.' + memberName + " = " +
                      Util.helperName (mType, true) + ".read (istream);"); // <d61056>
  }

  return index;
}
 
Example 20
Source File: TypedefGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  TypedefEntry td = (TypedefEntry)entry;
  String modifier = Util.arrayInfo (td.arrayInfo ());
  if (!modifier.equals (""))
  {
    // arrayInfo is a vector of Expressions which indicate the
    // number of array dimensions for this typedef.  But what if
    // this is a typedef of a sequence?
    // The `new' statement being generated must know the full
    // number of brackets.  That can be found in td.info.
    // For instance:
    // typedef sequence<short> A[10][10];
    // void proc (out A a);
    // typeModifier = "[10][10]"
    // td.info    = "short[][][]";
    // The first new statement generated is:
    // a.value = new short[10][][];
    // Note that the 3 sets of brackets come from td.info, not
    // arrayInfo;
    // The second new statement generated is:
    // a.value[_i1] = new short[10][];
    // ------------     ---- ------
    //    \           \    \
    //    name      baseName   arrayDcl
    int closingBrackets = 0;
    String loopIndex = "";
    String baseName;
    try
    {
      baseName = (String)td.dynamicVariable (Compile.typedefInfo);
    }
    catch (NoSuchFieldException e)
    {
      baseName = td.name ();
    }
    int startArray = baseName.indexOf ('[');
    String arrayDcl = Util.sansArrayInfo (baseName.substring (startArray)) + "[]"; // Add an extra set because the first gets stripped off in the loop.
    baseName = baseName.substring (0, startArray);

    // For interfaces having state, e.g., valuetypes.
    SymtabEntry baseEntry = (SymtabEntry)Util.symbolTable.get (baseName.replace ('.', '/'));
    if (baseEntry instanceof InterfaceEntry && ((InterfaceEntry)baseEntry).state () != null)
      // <f46082.51> Remove -stateful feature; javaStatefulName() obsolete.
      //baseName = Util.javaStatefulName ((InterfaceEntry)baseEntry);
      baseName = Util.javaName ((InterfaceEntry)baseEntry);

    int end1stArray;
    while (!modifier.equals (""))
    {
      int rbracket = modifier.indexOf (']');
      String size = modifier.substring (1, rbracket);
      end1stArray = arrayDcl.indexOf (']');
      arrayDcl = '[' + size + arrayDcl.substring (end1stArray + 2);
      stream.println (indent + name + " = new " + baseName + arrayDcl + ';');
      loopIndex = "_o" + index++;
      stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < (" + size + "); ++" + loopIndex + ')');
      stream.println (indent + '{');
      ++closingBrackets;
      modifier = modifier.substring (rbracket + 1);
      indent = indent + "  ";
      name = name + '[' + loopIndex + ']';
    }
    end1stArray = arrayDcl.indexOf (']');
    if (td.type () instanceof SequenceEntry || td.type () instanceof PrimitiveEntry || td.type () instanceof StringEntry)
      index = ((JavaGenerator)td.type ().generator ()).read (index, indent, name, td.type (), stream);
    else if (td.type () instanceof InterfaceEntry && td.type ().fullName ().equals ("org/omg/CORBA/Object"))
      stream.println (indent + name + " = istream.read_Object ();");
    else
      stream.println (indent + name + " = " + Util.helperName (td.type (), true) + ".read (istream);"); // <d61056>
    for (int i = 0; i < closingBrackets; ++i)
    {
      indent = indent.substring (2);
      stream.println (indent + '}');
    }
  }
  else
  {
    SymtabEntry tdtype = Util.typeOf (td.type ());
    if (tdtype instanceof SequenceEntry || tdtype instanceof PrimitiveEntry || tdtype instanceof StringEntry)
      index = ((JavaGenerator)tdtype.generator ()).read (index, indent, name, tdtype, stream);
    else if (tdtype instanceof InterfaceEntry && tdtype.fullName ().equals ("org/omg/CORBA/Object"))
      stream.println (indent + name + " = istream.read_Object ();");
    else
      stream.println (indent + name + " = " + Util.helperName (tdtype, true) + ".read (istream);"); // <d61056>
  }
  return index;
}