com.sun.tools.corba.se.idl.InterfaceState Java Examples

The following examples show how to use com.sun.tools.corba.se.idl.InterfaceState. 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: Holder.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the _read method.
 **/
protected void writeRead ()
{
  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;");

    else
      stream.println ("    value = " + helperClass + ".read (i);");
  }
  else
    stream.println ("    value = " + helperClass + ".read (i);");
  stream.println ("  }");
  stream.println ();
}
 
Example #2
Source File: Helper.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #3
Source File: ValueBoxGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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>
}
 
Example #4
Source File: ValueBoxGen.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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>
}
 
Example #5
Source File: Holder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the _read method.
 **/
protected void writeRead ()
{
  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;");

    else
      stream.println ("    value = " + helperClass + ".read (i);");
  }
  else
    stream.println ("    value = " + helperClass + ".read (i);");
  stream.println ("  }");
  stream.println ();
}
 
Example #6
Source File: Holder.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the _read method.
 **/
protected void writeRead ()
{
  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;");

    else
      stream.println ("    value = " + helperClass + ".read (i);");
  }
  else
    stream.println ("    value = " + helperClass + ".read (i);");
  stream.println ("  }");
  stream.println ();
}
 
Example #7
Source File: ValueBoxGen.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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>
}
 
Example #8
Source File: ValueBoxGen.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
   *
   **/
  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 ();
  }
 
Example #9
Source File: ValueGen.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
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);
  }
}
 
Example #10
Source File: ValueBoxGen.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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>
  else
    stream.println (indent + Util.helperName (mType, true) + ".write (ostream, " + name + ");"); // <d61056>
  return index;
}
 
Example #11
Source File: ValueBoxGen.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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>
}
 
Example #12
Source File: ValueBoxGen.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
   *
   **/
  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 ();
  }
 
Example #13
Source File: ValueBoxGen.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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>
  else
    stream.println (indent + Util.helperName (mType, true) + ".write (ostream, " + name + ");"); // <d61056>
  return index;
}
 
Example #14
Source File: ValueBoxGen.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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>
}
 
Example #15
Source File: ValueBoxGen.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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>
}
 
Example #16
Source File: ValueGen24.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * <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();
}
 
Example #17
Source File: ValueBoxGen.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
   *
   **/
  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 ();
  }
 
Example #18
Source File: Helper.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #19
Source File: ValueGen24.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * <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();
}
 
Example #20
Source File: ValueBoxGen.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
   *
   **/
  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 ();
  }
 
Example #21
Source File: Holder.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the _read method.
 **/
protected void writeRead ()
{
  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;");

    else
      stream.println ("    value = " + helperClass + ".read (i);");
  }
  else
    stream.println ("    value = " + helperClass + ".read (i);");
  stream.println ("  }");
  stream.println ();
}
 
Example #22
Source File: ValueGen.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
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);
  }
}
 
Example #23
Source File: Holder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the _read method.
 **/
protected void writeRead ()
{
  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;");

    else
      stream.println ("    value = " + helperClass + ".read (i);");
  }
  else
    stream.println ("    value = " + helperClass + ".read (i);");
  stream.println ("  }");
  stream.println ();
}
 
Example #24
Source File: ValueGen.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
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);
  }
}
 
Example #25
Source File: ValueBoxGen.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
   *
   **/
  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 ();
  }
 
Example #26
Source File: ValueGen24.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * <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();
}
 
Example #27
Source File: ValueGen24.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * <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();
}
 
Example #28
Source File: ValueGen24.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
}
 
Example #29
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 #30
Source File: ValueBoxGen.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream)
{
// <d59418 - KLR> per Simon, make "static" read call istream.read_value.
//                put real marshalling code in read_value.
  stream.println ("    return (" + entryName +") ((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (get_instance());"); // <d60929>
  stream.println ("  }");
  stream.println ();

  // done with "read", now do "read_value with real marshalling code.

  stream.println ("  public java.io.Serializable read_value (org.omg.CORBA.portable.InputStream istream)"); // <d60929>
  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
    stream.println (indent + Util.javaName (mType) + " tmp = " +
                    Util.helperName ( mType, true ) + ".read (istream);"); // <d61056>
  if (mType instanceof PrimitiveEntry)
    stream.println (indent + "return new " + entryName + " (tmp);");
  else
    stream.println (indent + "return tmp;");
}