com.sun.tools.corba.se.idl.TypedefEntry Java Examples
The following examples show how to use
com.sun.tools.corba.se.idl.TypedefEntry.
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: ValueBoxGen.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
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 #2
Source File: ValueBoxGen.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
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 #3
Source File: ConstGen.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * Write the constant's value according to its type. **/ private void writeConstValue (SymtabEntry type) { if (type instanceof PrimitiveEntry) stream.println ('(' + Util.javaName (type) + ")(" + Util.parseExpression (c.value ()) + ");"); else if (type instanceof StringEntry) stream.println (Util.parseExpression (c.value ()) + ';'); else if (type instanceof TypedefEntry) { while (type instanceof TypedefEntry) type = type.type (); writeConstValue (type); } else stream.println (Util.parseExpression (c.value ()) + ';'); }
Example #4
Source File: ConstGen.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * Write the constant's value according to its type. **/ private void writeConstValue (SymtabEntry type) { if (type instanceof PrimitiveEntry) stream.println ('(' + Util.javaName (type) + ")(" + Util.parseExpression (c.value ()) + ");"); else if (type instanceof StringEntry) stream.println (Util.parseExpression (c.value ()) + ';'); else if (type instanceof TypedefEntry) { while (type instanceof TypedefEntry) type = type.type (); writeConstValue (type); } else stream.println (Util.parseExpression (c.value ()) + ';'); }
Example #5
Source File: UnionGen.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private int readBranch (int index, String indent, String name, String disName, TypedefEntry entry, PrintWriter stream) { SymtabEntry type = entry.type (); Util.writeInitializer (indent, '_' + name, "", entry, stream); if (!entry.arrayInfo ().isEmpty () || type instanceof SequenceEntry || type instanceof PrimitiveEntry || type instanceof StringEntry) { index = ((JavaGenerator)entry.generator ()).read (index, indent, '_' + name, entry, stream); } else { stream.println (indent + '_' + name + " = " + Util.helperName (type, true) + ".read (istream);"); } stream.print (indent + "value." + name + " ("); if( disName == "" ) stream.println("_" + name + ");"); else stream.println(disName + ", " + "_" + name + ");"); return index; }
Example #6
Source File: ValueBoxGen.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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 #7
Source File: ValueBoxGen.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
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 openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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 #9
Source File: ValueBoxGen.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
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 #10
Source File: Util.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * **/ static private String checkForArrayBase (TypedefEntry t, Vector importTypes, Vector importList) { String arrays = ""; try { String name = (String)t.dynamicVariable (Compile.typedefInfo); int index = name.indexOf ('['); if (index >= 0) { arrays = name.substring (index); name = name.substring (0, index); } // See if the base type should be added to the list. SymtabEntry typeEntry = (SymtabEntry)symbolTable.get (name); if (typeEntry != null && importTypes.contains (typeEntry)) addTo (importList, typeEntry.name ()); } catch (NoSuchFieldException e) {} return arrays; }
Example #11
Source File: ValueBoxGen.java From hottub with GNU General Public License v2.0 | 6 votes |
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 #12
Source File: Helper.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * 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 #13
Source File: UnionGen.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private int readBranch (int index, String indent, String name, String disName, TypedefEntry entry, PrintWriter stream) { SymtabEntry type = entry.type (); Util.writeInitializer (indent, '_' + name, "", entry, stream); if (!entry.arrayInfo ().isEmpty () || type instanceof SequenceEntry || type instanceof PrimitiveEntry || type instanceof StringEntry) { index = ((JavaGenerator)entry.generator ()).read (index, indent, '_' + name, entry, stream); } else { stream.println (indent + '_' + name + " = " + Util.helperName (type, true) + ".read (istream);"); } stream.print (indent + "value." + name + " ("); if( disName == "" ) stream.println("_" + name + ");"); else stream.println(disName + ", " + "_" + name + ");"); return index; }
Example #14
Source File: Util.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * **/ static private String checkForArrayBase (TypedefEntry t, Vector importTypes, Vector importList) { String arrays = ""; try { String name = (String)t.dynamicVariable (Compile.typedefInfo); int index = name.indexOf ('['); if (index >= 0) { arrays = name.substring (index); name = name.substring (0, index); } // See if the base type should be added to the list. SymtabEntry typeEntry = (SymtabEntry)symbolTable.get (name); if (typeEntry != null && importTypes.contains (typeEntry)) addTo (importList, typeEntry.name ()); } catch (NoSuchFieldException e) {} return arrays; }
Example #15
Source File: ValueBoxGen.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
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: StructGen.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * **/ protected void writeMembers () { // Write members and populate quality arrays int size = s.members ().size (); memberIsPrimitive = new boolean [size]; memberIsInterface = new boolean [size]; memberIsTypedef = new boolean [size]; for (int i = 0; i < s.members ().size (); ++i) { SymtabEntry member = (SymtabEntry)s.members ().elementAt (i); memberIsPrimitive[i] = member.type () instanceof PrimitiveEntry; memberIsInterface[i] = member.type () instanceof InterfaceEntry; memberIsTypedef[i] = member.type () instanceof TypedefEntry; Util.fillInfo (member); // Transfer member comment to target <31jul1997>. if (member.comment () != null) member.comment ().generate (" ", stream); Util.writeInitializer (" public ", member.name (), "", member, stream); } }
Example #17
Source File: ValueBoxGen.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
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 #18
Source File: ValueBoxGen.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
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 #19
Source File: Util.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * **/ public static void writeInitializer (String indent, String name, String arrayDcl, SymtabEntry entry, PrintWriter stream) { if (entry instanceof TypedefEntry) { TypedefEntry td = (TypedefEntry)entry; writeInitializer (indent, name, arrayDcl + sansArrayInfo (td.arrayInfo ()), td.type (), stream); } else if (entry instanceof SequenceEntry) writeInitializer (indent, name, arrayDcl + "[]", entry.type (), stream); else if (entry instanceof EnumEntry) if (arrayDcl.length () > 0) stream.println (indent + javaName (entry) + ' ' + name + arrayDcl + " = null;"); else stream.println (indent + javaName (entry) + ' ' + name + " = null;"); else if (entry instanceof PrimitiveEntry) { boolean array = arrayDcl.length () > 0; String tname = javaPrimName (entry.name ()); if (tname.equals ("boolean")) stream.println (indent + "boolean " + name + arrayDcl + " = " + (array ? "null;" : "false;")); else if (tname.equals ("org.omg.CORBA.TypeCode")) stream.println (indent + "org.omg.CORBA.TypeCode " + name + arrayDcl + " = null;"); else if (tname.equals ("org.omg.CORBA.Any")) stream.println (indent + "org.omg.CORBA.Any " + name + arrayDcl + " = null;"); else if (tname.equals ("org.omg.CORBA.Principal")) // <d61961> stream.println (indent + "org.omg.CORBA.Principal " + name + arrayDcl + " = null;"); else stream.println (indent + tname + ' ' + name + arrayDcl + " = " + (array ? "null;" : '(' + tname + ")0;")); } // <f46082.51> Remove -stateful feature. This case is identical to next one // because javaName() supplants javaStatefulName(). //else if (entry instanceof InterfaceEntry && ((InterfaceEntry)entry).state () != null) // stream.println (indent + javaStatefulName ((InterfaceEntry)entry) + ' ' + name + arrayDcl + " = null;"); else stream.println (indent + javaName (entry) + ' ' + name + arrayDcl + " = null;"); }
Example #20
Source File: Util.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Determine the import lines for template types. **/ static private void checkForBounds (SymtabEntry entry, Vector importTypes, Vector importList) { // Obtain actual type, just to be complete. SymtabEntry entryType = entry; while (entryType instanceof TypedefEntry) entryType = entryType.type (); if (entryType instanceof StringEntry && ((StringEntry)entryType).maxSize () != null) checkForGlobalConstants (((StringEntry)entryType).maxSize ().rep (), importTypes, importList); else if (entryType instanceof SequenceEntry && ((SequenceEntry)entryType).maxSize () != null) checkForGlobalConstants (((SequenceEntry)entryType).maxSize ().rep (), importTypes, importList); }
Example #21
Source File: Util.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * **/ public static String holderName (SymtabEntry entry) { String name; if (entry instanceof PrimitiveEntry) if (entry.name ().equals ("any")) name = "org.omg.CORBA.AnyHolder"; else if (entry.name ().equals ("TypeCode")) name = "org.omg.CORBA.TypeCodeHolder"; else if (entry.name ().equals ("Principal")) // <d61961> name = "org.omg.CORBA.PrincipalHolder"; else name = "org.omg.CORBA." + capitalize (javaQualifiedName (entry)) + "Holder"; else if (entry instanceof TypedefEntry) { TypedefEntry td = (TypedefEntry)entry; if (!td.arrayInfo ().isEmpty () || td.type () instanceof SequenceEntry) name = javaQualifiedName (entry) + "Holder"; else name = holderName (entry.type ()); } else if (entry instanceof StringEntry) name = "org.omg.CORBA.StringHolder"; else if (entry instanceof ValueEntry) { if (entry.name ().equals ("ValueBase")) name = "org.omg.CORBA.ValueBaseHolder"; // <d59421>, <d60929> else name = javaName (entry) + "Holder"; } else if (entry instanceof NativeEntry) { // do not attach holder to the translation for Native Entries, e.g. // for Cookie it should be CookieHolder instead of java.lang.ObjectHolder // returns the complete name for the package, etc. name = javaQualifiedName(entry) + "Holder"; } else name = javaName (entry) + "Holder"; return name; }
Example #22
Source File: Util.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * **/ static private void checkForArrays (SymtabEntry entry, Vector importTypes, Vector importList) { if (entry instanceof TypedefEntry) { TypedefEntry t = (TypedefEntry)entry; String arrays = checkForArrayBase (t, importTypes, importList); checkForArrayDimensions (arrays, importTypes, importList); } }
Example #23
Source File: Util.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * **/ public static void writePackage (PrintWriter stream, SymtabEntry entry, short type) { String fullName = containerFullName (entry.container ()); if (fullName != null && !fullName.equals ("")) { stream.println ("package " + fullName.replace ('/', '.') + ';'); // This type is in a module. Just in case it refers to types // in the unnamed module, add an import statement for each of // those types. if ((type != HolderFile || entry instanceof TypedefEntry) && !Compile.compiler.importTypes.isEmpty ()) { stream.println (); Vector v = addImportLines (entry, Compile.compiler.importTypes, type); printImports (v, stream); } /* Enumeration e = Compile.compiler.importTypes.elements (); while (e.hasMoreElements ()) { SymtabEntry i = (SymtabEntry)e.nextElement (); // Write import for type if (!(i instanceof TypedefEntry)) stream.println ("import " + i.name () + ';'); // Write import for Helper if (!(i instanceof ConstEntry)) stream.println ("import " + i.name () + "Helper;"); // Write import for Holder if (!(i instanceof ConstEntry)) if (!(i instanceof TypedefEntry) || (i.type () instanceof SequenceEntry || !((TypedefEntry)i).arrayInfo ().isEmpty ())) stream.println ("import " + i.name () + "Holder;"); } */ } }
Example #24
Source File: TypedefGen.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * **/ public void generate (Hashtable symbolTable, TypedefEntry t, PrintWriter stream) { this.symbolTable = symbolTable; this.t = t; if (t.arrayInfo ().size () > 0 || t.type () instanceof SequenceEntry) generateHolder (); generateHelper (); }
Example #25
Source File: ValueBoxGen24.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * <d62023> **/ public void helperRead (String entryName, SymtabEntry entry, PrintWriter stream) { stream.println (" if (!(istream instanceof org.omg.CORBA_2_3.portable.InputStream)) {"); stream.println (" throw new org.omg.CORBA.BAD_PARAM(); }"); stream.println (" return (" + entryName +") ((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (_instance);"); 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 (" {"); 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;"); ((JavaGenerator)member.generator ()).read (0, indent, "tmp", member, stream); } else stream.println (indent + Util.javaName (mType) + " tmp = " + Util.helperName ( mType, true ) + ".read (istream);"); if (mType instanceof PrimitiveEntry) stream.println (indent + "return new " + entryName + " (tmp);"); else stream.println (indent + "return (java.io.Serializable) tmp;"); }
Example #26
Source File: StructGen.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream) { if (thisIsReallyAnException) { stream.println (indent + "// write the repository ID"); stream.println (indent + "ostream.write_string (id ());"); } Vector members = ((StructEntry)entry).members (); for (int i = 0; i < members.size (); ++i) { TypedefEntry member = (TypedefEntry)members.elementAt (i); SymtabEntry mType = member.type (); if (!member.arrayInfo ().isEmpty () || mType instanceof SequenceEntry || mType instanceof TypedefEntry || mType instanceof PrimitiveEntry || mType instanceof StringEntry) index = ((JavaGenerator)member.generator ()).write (index, " ", name + '.' + member.name (), member, stream); // <d62023-klr> for corbaLevel 2.4 and up, use Helper.write like // everything else else if ((mType instanceof ValueEntry || mType instanceof ValueBoxEntry) && !Util.corbaLevel (2.4f, 99.0f)) { // <d62023> stream.println (indent + "((org.omg.CORBA_2_3.portable.OutputStream)ostream).write_value ((java.io.Serializable) " // <d60929> + name + '.' + member.name () + ", " + Util.helperName (member.type (), true) // <d61056> + ".get_instance ());"); // <d61056> } else stream.println (indent + Util.helperName (member.type (), true) + ".write (ostream, " + name + '.' + member.name () + ");"); // <d61056> } return index; }
Example #27
Source File: Util.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * **/ public static SymtabEntry typeOf (SymtabEntry entry) { while (entry instanceof TypedefEntry && ((TypedefEntry)entry).arrayInfo ().isEmpty () && !(entry.type () instanceof SequenceEntry)) entry = entry.type (); return entry; }
Example #28
Source File: ValueGen.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private static boolean hasRepId (SymtabEntry member) { SymtabEntry mType = Util.typeOf (member); return !( mType instanceof PrimitiveEntry || mType instanceof StringEntry || ( mType instanceof TypedefEntry && !(((TypedefEntry)mType).arrayInfo ().isEmpty ()) ) || ( mType instanceof TypedefEntry && member.type () instanceof SequenceEntry) ); }
Example #29
Source File: Util.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * **/ public static void writePackage (PrintWriter stream, SymtabEntry entry, short type) { String fullName = containerFullName (entry.container ()); if (fullName != null && !fullName.equals ("")) { stream.println ("package " + fullName.replace ('/', '.') + ';'); // This type is in a module. Just in case it refers to types // in the unnamed module, add an import statement for each of // those types. if ((type != HolderFile || entry instanceof TypedefEntry) && !Compile.compiler.importTypes.isEmpty ()) { stream.println (); Vector v = addImportLines (entry, Compile.compiler.importTypes, type); printImports (v, stream); } /* Enumeration e = Compile.compiler.importTypes.elements (); while (e.hasMoreElements ()) { SymtabEntry i = (SymtabEntry)e.nextElement (); // Write import for type if (!(i instanceof TypedefEntry)) stream.println ("import " + i.name () + ';'); // Write import for Helper if (!(i instanceof ConstEntry)) stream.println ("import " + i.name () + "Helper;"); // Write import for Holder if (!(i instanceof ConstEntry)) if (!(i instanceof TypedefEntry) || (i.type () instanceof SequenceEntry || !((TypedefEntry)i).arrayInfo ().isEmpty ())) stream.println ("import " + i.name () + "Holder;"); } */ } }
Example #30
Source File: ValueGen24.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * <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; }