Java Code Examples for com.sun.tools.corba.se.idl.StringEntry#maxSize()

The following examples show how to use com.sun.tools.corba.se.idl.StringEntry#maxSize() . 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: StringGen.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) {
  tcoffsets.set (entry);
  StringEntry stringEntry = (StringEntry)entry;
  String bound;
  if (stringEntry.maxSize () == null)
    bound = "0";
  else
    bound = Util.parseExpression (stringEntry.maxSize ());

  // entry.name() is necessary to determine whether it is a
  // string or wstring

  stream.println (indent
                  + name
                  + " = org.omg.CORBA.ORB.init ().create_"
                  + entry.name()
                  + "_tc ("
                  + bound + ");");
  return index;
}
 
Example 2
Source File: StringGen.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) {
  tcoffsets.set (entry);
  StringEntry stringEntry = (StringEntry)entry;
  String bound;
  if (stringEntry.maxSize () == null)
    bound = "0";
  else
    bound = Util.parseExpression (stringEntry.maxSize ());

  // entry.name() is necessary to determine whether it is a
  // string or wstring

  stream.println (indent
                  + name
                  + " = org.omg.CORBA.ORB.init ().create_"
                  + entry.name()
                  + "_tc ("
                  + bound + ");");
  return index;
}
 
Example 3
Source File: StringGen.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) {
  tcoffsets.set (entry);
  StringEntry stringEntry = (StringEntry)entry;
  String bound;
  if (stringEntry.maxSize () == null)
    bound = "0";
  else
    bound = Util.parseExpression (stringEntry.maxSize ());

  // entry.name() is necessary to determine whether it is a
  // string or wstring

  stream.println (indent
                  + name
                  + " = org.omg.CORBA.ORB.init ().create_"
                  + entry.name()
                  + "_tc ("
                  + bound + ");");
  return index;
}
 
Example 4
Source File: StringGen.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) {
  tcoffsets.set (entry);
  StringEntry stringEntry = (StringEntry)entry;
  String bound;
  if (stringEntry.maxSize () == null)
    bound = "0";
  else
    bound = Util.parseExpression (stringEntry.maxSize ());

  // entry.name() is necessary to determine whether it is a
  // string or wstring

  stream.println (indent
                  + name
                  + " = org.omg.CORBA.ORB.init ().create_"
                  + entry.name()
                  + "_tc ("
                  + bound + ");");
  return index;
}
 
Example 5
Source File: StringGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public int type (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream) {
  tcoffsets.set (entry);
  StringEntry stringEntry = (StringEntry)entry;
  String bound;
  if (stringEntry.maxSize () == null)
    bound = "0";
  else
    bound = Util.parseExpression (stringEntry.maxSize ());

  // entry.name() is necessary to determine whether it is a
  // string or wstring

  stream.println (indent
                  + name
                  + " = org.omg.CORBA.ORB.init ().create_"
                  + entry.name()
                  + "_tc ("
                  + bound + ");");
  return index;
}
 
Example 6
Source File: StringGen.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)
{
  StringEntry string = (StringEntry)entry;
  if (string.maxSize () != null)
  {
    stream.print (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))");
    stream.println (indent + "  throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);");
  }
  String entryName = entry.name ();
  if (entryName.equals ("string"))
    stream.println (indent + "ostream.write_string (" + name + ");");
  else if (entryName.equals ("wstring"))
    stream.println (indent + "ostream.write_wstring (" + name + ");");
  return index;
}
 
Example 7
Source File: MethodGen.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 **/
private void writeType (String indent, String name, SymtabEntry type, PrintWriter stream)
{
  if (type instanceof PrimitiveEntry)
  {
    // RJB does something have to be done with TC offsets?
    if (type.name ().equals ("long long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_longlong));");
    else if (type.name ().equals ("unsigned short"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ushort));");
    else if (type.name ().equals ("unsigned long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong));");
    else if (type.name ().equals ("unsigned long long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulonglong));");
    else
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_" + type.name () + "));");
  }
  else if (type instanceof StringEntry)
  {
    StringEntry s = (StringEntry)type;
    Expression e  = s.maxSize ();
    if (e == null)
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (" + Util.parseExpression (e) + "));");
   else
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (0));");
  }
  else
    stream.println (indent + name + '(' + Util.helperName (type, true) + ".type ());"); // <d61056>
}
 
Example 8
Source File: StringGen.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  StringEntry string = (StringEntry)entry;
  String entryName = entry.name ();
  if (entryName.equals ("string"))
    stream.println (indent + name + " = istream.read_string ();");
  else if (entryName.equals ("wstring"))
    stream.println (indent + name + " = istream.read_wstring ();");
  if (string.maxSize () != null)
  {
    stream.println (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))");
    stream.println (indent + "  throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);");
  }
  return index;
}
 
Example 9
Source File: MethodGen.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 **/
private void writeType (String indent, String name, SymtabEntry type, PrintWriter stream)
{
  if (type instanceof PrimitiveEntry)
  {
    // RJB does something have to be done with TC offsets?
    if (type.name ().equals ("long long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_longlong));");
    else if (type.name ().equals ("unsigned short"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ushort));");
    else if (type.name ().equals ("unsigned long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong));");
    else if (type.name ().equals ("unsigned long long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulonglong));");
    else
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_" + type.name () + "));");
  }
  else if (type instanceof StringEntry)
  {
    StringEntry s = (StringEntry)type;
    Expression e  = s.maxSize ();
    if (e == null)
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (" + Util.parseExpression (e) + "));");
   else
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (0));");
  }
  else
    stream.println (indent + name + '(' + Util.helperName (type, true) + ".type ());"); // <d61056>
}
 
Example 10
Source File: StringGen.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)
{
  StringEntry string = (StringEntry)entry;
  if (string.maxSize () != null)
  {
    stream.print (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))");
    stream.println (indent + "  throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);");
  }
  String entryName = entry.name ();
  if (entryName.equals ("string"))
    stream.println (indent + "ostream.write_string (" + name + ");");
  else if (entryName.equals ("wstring"))
    stream.println (indent + "ostream.write_wstring (" + name + ");");
  return index;
}
 
Example 11
Source File: StringGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  StringEntry string = (StringEntry)entry;
  String entryName = entry.name ();
  if (entryName.equals ("string"))
    stream.println (indent + name + " = istream.read_string ();");
  else if (entryName.equals ("wstring"))
    stream.println (indent + name + " = istream.read_wstring ();");
  if (string.maxSize () != null)
  {
    stream.println (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))");
    stream.println (indent + "  throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);");
  }
  return index;
}
 
Example 12
Source File: MethodGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 **/
private void writeType (String indent, String name, SymtabEntry type, PrintWriter stream)
{
  if (type instanceof PrimitiveEntry)
  {
    // RJB does something have to be done with TC offsets?
    if (type.name ().equals ("long long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_longlong));");
    else if (type.name ().equals ("unsigned short"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ushort));");
    else if (type.name ().equals ("unsigned long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong));");
    else if (type.name ().equals ("unsigned long long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulonglong));");
    else
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_" + type.name () + "));");
  }
  else if (type instanceof StringEntry)
  {
    StringEntry s = (StringEntry)type;
    Expression e  = s.maxSize ();
    if (e == null)
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (" + Util.parseExpression (e) + "));");
   else
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (0));");
  }
  else
    stream.println (indent + name + '(' + Util.helperName (type, true) + ".type ());"); // <d61056>
}
 
Example 13
Source File: StringGen.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)
{
  StringEntry string = (StringEntry)entry;
  if (string.maxSize () != null)
  {
    stream.print (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))");
    stream.println (indent + "  throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);");
  }
  String entryName = entry.name ();
  if (entryName.equals ("string"))
    stream.println (indent + "ostream.write_string (" + name + ");");
  else if (entryName.equals ("wstring"))
    stream.println (indent + "ostream.write_wstring (" + name + ");");
  return index;
}
 
Example 14
Source File: StringGen.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  StringEntry string = (StringEntry)entry;
  String entryName = entry.name ();
  if (entryName.equals ("string"))
    stream.println (indent + name + " = istream.read_string ();");
  else if (entryName.equals ("wstring"))
    stream.println (indent + name + " = istream.read_wstring ();");
  if (string.maxSize () != null)
  {
    stream.println (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))");
    stream.println (indent + "  throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);");
  }
  return index;
}
 
Example 15
Source File: MethodGen.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 **/
private void writeType (String indent, String name, SymtabEntry type, PrintWriter stream)
{
  if (type instanceof PrimitiveEntry)
  {
    // RJB does something have to be done with TC offsets?
    if (type.name ().equals ("long long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_longlong));");
    else if (type.name ().equals ("unsigned short"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ushort));");
    else if (type.name ().equals ("unsigned long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong));");
    else if (type.name ().equals ("unsigned long long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulonglong));");
    else
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_" + type.name () + "));");
  }
  else if (type instanceof StringEntry)
  {
    StringEntry s = (StringEntry)type;
    Expression e  = s.maxSize ();
    if (e == null)
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (" + Util.parseExpression (e) + "));");
   else
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (0));");
  }
  else
    stream.println (indent + name + '(' + Util.helperName (type, true) + ".type ());"); // <d61056>
}
 
Example 16
Source File: StringGen.java    From jdk8u60 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)
{
  StringEntry string = (StringEntry)entry;
  if (string.maxSize () != null)
  {
    stream.print (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))");
    stream.println (indent + "  throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);");
  }
  String entryName = entry.name ();
  if (entryName.equals ("string"))
    stream.println (indent + "ostream.write_string (" + name + ");");
  else if (entryName.equals ("wstring"))
    stream.println (indent + "ostream.write_wstring (" + name + ");");
  return index;
}
 
Example 17
Source File: StringGen.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  StringEntry string = (StringEntry)entry;
  String entryName = entry.name ();
  if (entryName.equals ("string"))
    stream.println (indent + name + " = istream.read_string ();");
  else if (entryName.equals ("wstring"))
    stream.println (indent + name + " = istream.read_wstring ();");
  if (string.maxSize () != null)
  {
    stream.println (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))");
    stream.println (indent + "  throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);");
  }
  return index;
}
 
Example 18
Source File: MethodGen.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 **/
private void writeType (String indent, String name, SymtabEntry type, PrintWriter stream)
{
  if (type instanceof PrimitiveEntry)
  {
    // RJB does something have to be done with TC offsets?
    if (type.name ().equals ("long long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_longlong));");
    else if (type.name ().equals ("unsigned short"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ushort));");
    else if (type.name ().equals ("unsigned long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong));");
    else if (type.name ().equals ("unsigned long long"))
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulonglong));");
    else
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_" + type.name () + "));");
  }
  else if (type instanceof StringEntry)
  {
    StringEntry s = (StringEntry)type;
    Expression e  = s.maxSize ();
    if (e == null)
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (" + Util.parseExpression (e) + "));");
   else
      stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (0));");
  }
  else
    stream.println (indent + name + '(' + Util.helperName (type, true) + ".type ());"); // <d61056>
}
 
Example 19
Source File: StringGen.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)
{
  StringEntry string = (StringEntry)entry;
  if (string.maxSize () != null)
  {
    stream.print (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))");
    stream.println (indent + "  throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);");
  }
  String entryName = entry.name ();
  if (entryName.equals ("string"))
    stream.println (indent + "ostream.write_string (" + name + ");");
  else if (entryName.equals ("wstring"))
    stream.println (indent + "ostream.write_wstring (" + name + ");");
  return index;
}
 
Example 20
Source File: StringGen.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public int read (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
{
  StringEntry string = (StringEntry)entry;
  String entryName = entry.name ();
  if (entryName.equals ("string"))
    stream.println (indent + name + " = istream.read_string ();");
  else if (entryName.equals ("wstring"))
    stream.println (indent + name + " = istream.read_wstring ();");
  if (string.maxSize () != null)
  {
    stream.println (indent + "if (" + name + ".length () > (" + Util.parseExpression (string.maxSize ()) + "))");
    stream.println (indent + "  throw new org.omg.CORBA.MARSHAL (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);");
  }
  return index;
}