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

The following examples show how to use com.sun.tools.corba.se.idl.SymtabEntry#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: MethodGen.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
private void writeInsert (String indent, String target, String source, SymtabEntry type, PrintWriter stream)
{
  String typeName = type.name ();
  if (type instanceof PrimitiveEntry)
  {
    // RJB does something have to be done with TC offsets?
    if (typeName.equals ("long long"))
      stream.println (indent + source + ".insert_longlong (" + target + ");");
    else if (typeName.equals ("unsigned short"))
      stream.println (indent + source + ".insert_ushort (" + target + ");");
    else if (typeName.equals ("unsigned long"))
      stream.println (indent + source + ".insert_ulong (" + target + ");");
    else if (typeName.equals ("unsigned long long"))
      stream.println (indent + source + ".insert_ulonglong (" + target + ");");
    else
      stream.println (indent + source + ".insert_" + typeName + " (" + target + ");");
  }
  else if (type instanceof StringEntry)
    stream.println (indent + source + ".insert_" + typeName + " (" + target + ");");
  else
    stream.println (indent + Util.helperName (type, true) + ".insert (" + source + ", " + target + ");"); // <d61056>
}
 
Example 2
Source File: Util.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Given a symtabEntry, return the name of this entry. This
 * method does not do any conversions like javaName does.
 **/
public static String javaQualifiedName (SymtabEntry entry)
{
  String name = "";
  if (entry instanceof PrimitiveEntry)
    name = javaPrimName (entry.name ());
  else if (entry instanceof StringEntry)
    name = "String";
  else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase"))
    name = "java.io.Serializable";
  else
  {
    SymtabEntry container = entry.container ();
    if (container != null)
      name = container.name ();
    if (name.equals (""))
      name = entry.name ();
    else
      name = containerFullName (entry.container ()) + '.' + entry.name ();
  }
  return name.replace ('/', '.');
}
 
Example 3
Source File: MethodGen.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
private String writeExtract (String source, SymtabEntry type)
{
  String extract;
  if (type instanceof PrimitiveEntry)
  {
    if (type.name ().equals ("long long"))
      extract = source + ".extract_longlong ()";
    else if (type.name ().equals ("unsigned short"))
      extract = source + ".extract_ushort ()";
    else if (type.name ().equals ("unsigned long"))
      extract = source + ".extract_ulong ()";
    else if (type.name ().equals ("unsigned long long"))
      extract = source + ".extract_ulonglong ()";
    else
      extract = source + ".extract_" + type.name () + " ()";
  }
  else if (type instanceof StringEntry)
    extract = source + ".extract_" + type.name () + " ()";
  else
    extract = Util.helperName (type, true) + ".extract (" + source + ')'; // <d61056>
  return extract;
}
 
Example 4
Source File: Util.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example 5
Source File: MethodGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
private String writeInputStreamRead (String source, SymtabEntry type)
{
  String read = "";
  if (type instanceof PrimitiveEntry)
  {
    if (type.name ().equals ("long long"))
      read = source + ".read_longlong ()";
    else if (type.name ().equals ("unsigned short"))
      read = source + ".read_ushort ()";
    else if (type.name ().equals ("unsigned long"))
      read = source + ".read_ulong ()";
    else if (type.name ().equals ("unsigned long long"))
      read = source + ".read_ulonglong ()";
    else
      read = source + ".read_" + type.name () + " ()";
  }
  else if (type instanceof StringEntry)
    read = source + ".read_" + type.name () + " ()";
  else
    read = Util.helperName (type, true) + ".read (" + source + ')'; // <d61056>
  return read;
}
 
Example 6
Source File: Util.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example 7
Source File: MethodGen.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
private String writeInputStreamRead (String source, SymtabEntry type)
{
  String read = "";
  if (type instanceof PrimitiveEntry)
  {
    if (type.name ().equals ("long long"))
      read = source + ".read_longlong ()";
    else if (type.name ().equals ("unsigned short"))
      read = source + ".read_ushort ()";
    else if (type.name ().equals ("unsigned long"))
      read = source + ".read_ulong ()";
    else if (type.name ().equals ("unsigned long long"))
      read = source + ".read_ulonglong ()";
    else
      read = source + ".read_" + type.name () + " ()";
  }
  else if (type instanceof StringEntry)
    read = source + ".read_" + type.name () + " ()";
  else
    read = Util.helperName (type, true) + ".read (" + source + ')'; // <d61056>
  return read;
}
 
Example 8
Source File: MethodGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
private String writeExtract (String source, SymtabEntry type)
{
  String extract;
  if (type instanceof PrimitiveEntry)
  {
    if (type.name ().equals ("long long"))
      extract = source + ".extract_longlong ()";
    else if (type.name ().equals ("unsigned short"))
      extract = source + ".extract_ushort ()";
    else if (type.name ().equals ("unsigned long"))
      extract = source + ".extract_ulong ()";
    else if (type.name ().equals ("unsigned long long"))
      extract = source + ".extract_ulonglong ()";
    else
      extract = source + ".extract_" + type.name () + " ()";
  }
  else if (type instanceof StringEntry)
    extract = source + ".extract_" + type.name () + " ()";
  else
    extract = Util.helperName (type, true) + ".extract (" + source + ')'; // <d61056>
  return extract;
}
 
Example 9
Source File: Util.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Given a symtabEntry, return the name of this entry. This
 * method does not do any conversions like javaName does.
 **/
public static String javaQualifiedName (SymtabEntry entry)
{
  String name = "";
  if (entry instanceof PrimitiveEntry)
    name = javaPrimName (entry.name ());
  else if (entry instanceof StringEntry)
    name = "String";
  else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase"))
    name = "java.io.Serializable";
  else
  {
    SymtabEntry container = entry.container ();
    if (container != null)
      name = container.name ();
    if (name.equals (""))
      name = entry.name ();
    else
      name = containerFullName (entry.container ()) + '.' + entry.name ();
  }
  return name.replace ('/', '.');
}
 
Example 10
Source File: MethodGen.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
private String writeExtract (String source, SymtabEntry type)
{
  String extract;
  if (type instanceof PrimitiveEntry)
  {
    if (type.name ().equals ("long long"))
      extract = source + ".extract_longlong ()";
    else if (type.name ().equals ("unsigned short"))
      extract = source + ".extract_ushort ()";
    else if (type.name ().equals ("unsigned long"))
      extract = source + ".extract_ulong ()";
    else if (type.name ().equals ("unsigned long long"))
      extract = source + ".extract_ulonglong ()";
    else
      extract = source + ".extract_" + type.name () + " ()";
  }
  else if (type instanceof StringEntry)
    extract = source + ".extract_" + type.name () + " ()";
  else
    extract = Util.helperName (type, true) + ".extract (" + source + ')'; // <d61056>
  return extract;
}
 
Example 11
Source File: Util.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example 12
Source File: Util.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Given a symtabEntry, return the name of this entry. This
 * method does not do any conversions like javaName does.
 **/
public static String javaQualifiedName (SymtabEntry entry)
{
  String name = "";
  if (entry instanceof PrimitiveEntry)
    name = javaPrimName (entry.name ());
  else if (entry instanceof StringEntry)
    name = "String";
  else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase"))
    name = "java.io.Serializable";
  else
  {
    SymtabEntry container = entry.container ();
    if (container != null)
      name = container.name ();
    if (name.equals (""))
      name = entry.name ();
    else
      name = containerFullName (entry.container ()) + '.' + entry.name ();
  }
  return name.replace ('/', '.');
}
 
Example 13
Source File: MethodGen.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
private String writeInputStreamRead (String source, SymtabEntry type)
{
  String read = "";
  if (type instanceof PrimitiveEntry)
  {
    if (type.name ().equals ("long long"))
      read = source + ".read_longlong ()";
    else if (type.name ().equals ("unsigned short"))
      read = source + ".read_ushort ()";
    else if (type.name ().equals ("unsigned long"))
      read = source + ".read_ulong ()";
    else if (type.name ().equals ("unsigned long long"))
      read = source + ".read_ulonglong ()";
    else
      read = source + ".read_" + type.name () + " ()";
  }
  else if (type instanceof StringEntry)
    read = source + ".read_" + type.name () + " ()";
  else
    read = Util.helperName (type, true) + ".read (" + source + ')'; // <d61056>
  return read;
}
 
Example 14
Source File: Util.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static String fileName (SymtabEntry entry, NameModifier modifier, String extension )
{
  // This may not be the most appropriate place for
  // the mkdir calls, but it's common to everything:
  String pkg = containerFullName (entry.container ());
  if (pkg != null && !pkg.equals (""))
    mkdir (pkg);

  String name = entry.name ();
  name = modifier.makeName( name ) + extension ;
  if (pkg != null && !pkg.equals (""))
    name = pkg + '/' + name;

  return name.replace ('/', File.separatorChar);
}
 
Example 15
Source File: StringGen.java    From hottub 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 16
Source File: StringGen.java    From openjdk-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;
}
 
Example 17
Source File: Util.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Given a SymtabEntry, return the string which should be used
 * for this entry. Enums are converted to ints, typedefs and
 * sequences are converted to their info types. javaQualifiedName
 * does not do any of these conversions.
 **/
public static String javaName (SymtabEntry entry)
{
  // First get the real name of this type
  String name = "";
  if (entry instanceof TypedefEntry || entry instanceof SequenceEntry)
    try
    {
      name = sansArrayInfo ((String)entry.dynamicVariable (Compile.typedefInfo));
    }
    catch (NoSuchFieldException e)
    {
      name = entry.name ();
    }
  else if (entry instanceof PrimitiveEntry)
    name = javaPrimName (entry.name ());
  else if (entry instanceof StringEntry)
    name = "String";
  else if (entry instanceof NativeEntry)
    name = javaNativeName (entry.name());
  else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase"))
      name = "java.io.Serializable";
  else if (entry instanceof ValueBoxEntry)
  {
    ValueBoxEntry v = (ValueBoxEntry) entry;
    TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
    SymtabEntry mType = member.type ();
    if (mType instanceof PrimitiveEntry)
    {
       name = containerFullName (entry.container ());
       if (!name.equals (""))
         name = name + '.';
       name = name + entry.name ();
    }
    else
       name = javaName (mType);
  }
  else
  {
    name = containerFullName (entry.container ());
    if (name.equals (""))
      name = entry.name ();
    else
      name = name + '.' + entry.name ();
  }

  // Make it a fully package-qualified name
  return name.replace ('/', '.');
}
 
Example 18
Source File: Util.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Given a SymtabEntry, return the string which should be used
 * for this entry. Enums are converted to ints, typedefs and
 * sequences are converted to their info types. javaQualifiedName
 * does not do any of these conversions.
 **/
public static String javaName (SymtabEntry entry)
{
  // First get the real name of this type
  String name = "";
  if (entry instanceof TypedefEntry || entry instanceof SequenceEntry)
    try
    {
      name = sansArrayInfo ((String)entry.dynamicVariable (Compile.typedefInfo));
    }
    catch (NoSuchFieldException e)
    {
      name = entry.name ();
    }
  else if (entry instanceof PrimitiveEntry)
    name = javaPrimName (entry.name ());
  else if (entry instanceof StringEntry)
    name = "String";
  else if (entry instanceof NativeEntry)
    name = javaNativeName (entry.name());
  else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase"))
      name = "java.io.Serializable";
  else if (entry instanceof ValueBoxEntry)
  {
    ValueBoxEntry v = (ValueBoxEntry) entry;
    TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
    SymtabEntry mType = member.type ();
    if (mType instanceof PrimitiveEntry)
    {
       name = containerFullName (entry.container ());
       if (!name.equals (""))
         name = name + '.';
       name = name + entry.name ();
    }
    else
       name = javaName (mType);
  }
  else
  {
    name = containerFullName (entry.container ());
    if (name.equals (""))
      name = entry.name ();
    else
      name = name + '.' + entry.name ();
  }

  // Make it a fully package-qualified name
  return name.replace ('/', '.');
}
 
Example 19
Source File: Util.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Given a SymtabEntry, return the string which should be used
 * for this entry. Enums are converted to ints, typedefs and
 * sequences are converted to their info types. javaQualifiedName
 * does not do any of these conversions.
 **/
public static String javaName (SymtabEntry entry)
{
  // First get the real name of this type
  String name = "";
  if (entry instanceof TypedefEntry || entry instanceof SequenceEntry)
    try
    {
      name = sansArrayInfo ((String)entry.dynamicVariable (Compile.typedefInfo));
    }
    catch (NoSuchFieldException e)
    {
      name = entry.name ();
    }
  else if (entry instanceof PrimitiveEntry)
    name = javaPrimName (entry.name ());
  else if (entry instanceof StringEntry)
    name = "String";
  else if (entry instanceof NativeEntry)
    name = javaNativeName (entry.name());
  else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase"))
      name = "java.io.Serializable";
  else if (entry instanceof ValueBoxEntry)
  {
    ValueBoxEntry v = (ValueBoxEntry) entry;
    TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
    SymtabEntry mType = member.type ();
    if (mType instanceof PrimitiveEntry)
    {
       name = containerFullName (entry.container ());
       if (!name.equals (""))
         name = name + '.';
       name = name + entry.name ();
    }
    else
       name = javaName (mType);
  }
  else
  {
    name = containerFullName (entry.container ());
    if (name.equals (""))
      name = entry.name ();
    else
      name = name + '.' + entry.name ();
  }

  // Make it a fully package-qualified name
  return name.replace ('/', '.');
}
 
Example 20
Source File: Util.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Given a SymtabEntry, return the string which should be used
 * for this entry. Enums are converted to ints, typedefs and
 * sequences are converted to their info types. javaQualifiedName
 * does not do any of these conversions.
 **/
public static String javaName (SymtabEntry entry)
{
  // First get the real name of this type
  String name = "";
  if (entry instanceof TypedefEntry || entry instanceof SequenceEntry)
    try
    {
      name = sansArrayInfo ((String)entry.dynamicVariable (Compile.typedefInfo));
    }
    catch (NoSuchFieldException e)
    {
      name = entry.name ();
    }
  else if (entry instanceof PrimitiveEntry)
    name = javaPrimName (entry.name ());
  else if (entry instanceof StringEntry)
    name = "String";
  else if (entry instanceof NativeEntry)
    name = javaNativeName (entry.name());
  else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase"))
      name = "java.io.Serializable";
  else if (entry instanceof ValueBoxEntry)
  {
    ValueBoxEntry v = (ValueBoxEntry) entry;
    TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
    SymtabEntry mType = member.type ();
    if (mType instanceof PrimitiveEntry)
    {
       name = containerFullName (entry.container ());
       if (!name.equals (""))
         name = name + '.';
       name = name + entry.name ();
    }
    else
       name = javaName (mType);
  }
  else
  {
    name = containerFullName (entry.container ());
    if (name.equals (""))
      name = entry.name ();
    else
      name = name + '.' + entry.name ();
  }

  // Make it a fully package-qualified name
  return name.replace ('/', '.');
}