sun.rmi.rmic.IndentingWriter Java Examples

The following examples show how to use sun.rmi.rmic.IndentingWriter. 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: IDLGenerator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Write an exception.
 * @param t Given ClassType representing the exception.
 * @param p The output stream.
 */
protected void writeException(
                              ClassType t,
                              IndentingWriter p)
    throws IOException {
    writeBanner( t,0,isException,p );
    writeIfndef( t,0,isException,!isForward,p );
    writeForwardReference( t,p );
    writeModule1( t,p );
    p.pln();p.pI();

    p.pln( "exception " + t.getIDLExceptionName() + " {" );
    p.pln();p.pI();
    p.pln( t.getIDLName() + " value;" );
    p.pO();p.pln();
    p.pln( "};" );

    p.pO();p.pln();
    writeModule2( t,p );
    writeInclude( t,0,!isThrown,p );               //include valuetype idl file
    writeEndif( p );
}
 
Example #2
Source File: IDLGenerator.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Write an IDL interface definition for a Java implementation class
 * @param t The current ImplementationType
 * @param p The output stream.
 */
protected void writeImplementation(
                                   ImplementationType t,
                                   IndentingWriter p )
    throws IOException {
    Hashtable inhHash = new Hashtable();
    Hashtable refHash = new Hashtable();
    getInterfaces( t,inhHash );                            //collect interfaces

    writeBanner( t,0,!isException,p );
    writeInheritedIncludes( inhHash,p );
    writeIfndef( t,0,!isException,!isForward,p );
    writeIncOrb( p );
    writeModule1( t,p );
    p.pln();p.pI();
    p.p( "interface " + t.getIDLName() );
    writeInherits( inhHash,!forValuetype,p );

    p.pln( " {" );
    p.pln( "};" );

    p.pO();p.pln();
    writeModule2( t,p );
    writeEpilog( t,refHash,p );
}
 
Example #3
Source File: IDLGenerator.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Write forward reference for given type
 * @param t Given type
 * @param p The output stream.
 */
protected void writeForwardReference(
                                     Type t,
                                     IndentingWriter p )
    throws IOException {
    String qName = t.getQualifiedName();
    if ( "java.lang.String".equals( qName ) ) ;
    else if ( "org.omg.CORBA.Object".equals( qName ) ) return ;    //no fwd dcl

    writeIfndef( t,0,!isException,isForward,p );
        writeModule1( t,p );
        p.pln();p.pI();
        switch ( t.getTypeCode() ) {
    case TYPE_NC_CLASS:
        case TYPE_NC_INTERFACE: p.p( "abstract valuetype " ); break;
        case TYPE_ABSTRACT:     p.p( "abstract interface " ); break;
        case TYPE_VALUE:        p.p( "valuetype " ); break;
    case TYPE_REMOTE:
    case TYPE_CORBA_OBJECT: p.p( "interface " ); break;
        default: ;                              //all other types were filtered
        }
        p.pln( t.getIDLName() + ";" );
        p.pO();p.pln();
        writeModule2( t,p );
    writeEndif( p );
    }
 
Example #4
Source File: IDLGenerator.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Write an IDL interface definition for a Java implementation class
 * @param t The current ImplementationType
 * @param p The output stream.
 */
protected void writeImplementation(
                                   ImplementationType t,
                                   IndentingWriter p )
    throws IOException {
    Hashtable inhHash = new Hashtable();
    Hashtable refHash = new Hashtable();
    getInterfaces( t,inhHash );                            //collect interfaces

    writeBanner( t,0,!isException,p );
    writeInheritedIncludes( inhHash,p );
    writeIfndef( t,0,!isException,!isForward,p );
    writeIncOrb( p );
    writeModule1( t,p );
    p.pln();p.pI();
    p.p( "interface " + t.getIDLName() );
    writeInherits( inhHash,!forValuetype,p );

    p.pln( " {" );
    p.pln( "};" );

    p.pO();p.pln();
    writeModule2( t,p );
    writeEpilog( t,refHash,p );
}
 
Example #5
Source File: IDLGenerator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Write special typedef
 * @param t A special Type.
 * @param p The output stream.
 */
protected void writeSpecial(
                            Type t,
                            IndentingWriter p )
    throws IOException {
    String spcName = t.getQualifiedName();
    if ( "java.io.Serializable".equals( spcName ) )
        writeJavaIoSerializable( t,p );
    else if ( "java.io.Externalizable".equals( spcName ) )
        writeJavaIoExternalizable( t,p );
    else if ( "java.lang.Object".equals( spcName) )
        writeJavaLangObject( t,p );
    else if ( "java.rmi.Remote".equals( spcName) )
        writeJavaRmiRemote( t,p );
    else if ( "org.omg.CORBA.portable.IDLEntity".equals( spcName) )
        writeIDLEntity( t,p );
}
 
Example #6
Source File: IDLGenerator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Write an IDL interface definition for a Java implementation class
 * @param t The current ImplementationType
 * @param p The output stream.
 */
protected void writeImplementation(
                                   ImplementationType t,
                                   IndentingWriter p )
    throws IOException {
    Hashtable inhHash = new Hashtable();
    Hashtable refHash = new Hashtable();
    getInterfaces( t,inhHash );                            //collect interfaces

    writeBanner( t,0,!isException,p );
    writeInheritedIncludes( inhHash,p );
    writeIfndef( t,0,!isException,!isForward,p );
    writeIncOrb( p );
    writeModule1( t,p );
    p.pln();p.pI();
    p.p( "interface " + t.getIDLName() );
    writeInherits( inhHash,!forValuetype,p );

    p.pln( " {" );
    p.pln( "};" );

    p.pO();p.pln();
    writeModule2( t,p );
    writeEpilog( t,refHash,p );
}
 
Example #7
Source File: Type.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Print the "opening" of the package or module of this type.
 * @param writer The stream to print to.
 * @param useIDLNames If true, print IDL names; otherwise, print java names.
 */
protected void printPackageOpen (   IndentingWriter writer,
                                    boolean useIDLNames) throws IOException {

    if (useIDLNames) {
        String[] moduleNames = getIDLModuleNames();
        for (int i = 0; i < moduleNames.length; i++ ) {
            writer.plnI("module " + moduleNames[i] + " {");
        }
    } else {
        String packageName = getPackageName();
        if (packageName != null) {
            writer.pln("package " + packageName + ";");
        }
    }
}
 
Example #8
Source File: IDLGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Write forward references for referenced interfaces and valuetypes
 * ...but not if the reference is to a boxed IDLEntity,
 * @param refHash Hashtable loaded with referenced types
 * @param p The output stream.
 */
protected void writeForwardReferences(
                                      Hashtable refHash,
                                      IndentingWriter p )
    throws IOException {
    Enumeration refEnum = refHash.elements();
    nextReference:
    while ( refEnum.hasMoreElements() ) {
        Type t = (Type)refEnum.nextElement();
        if ( t.isCompound() ) {
            CompoundType ct = (CompoundType)t;
            if ( ct.isIDLEntity() )
                continue nextReference;                  //ignore IDLEntity reference
        }
        writeForwardReference( t,p );
    }
}
 
Example #9
Source File: Type.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Print the "opening" of the package or module of this type.
 * @param writer The stream to print to.
 * @param useIDLNames If true, print IDL names; otherwise, print java names.
 */
protected void printPackageOpen (   IndentingWriter writer,
                                    boolean useIDLNames) throws IOException {

    if (useIDLNames) {
        String[] moduleNames = getIDLModuleNames();
        for (int i = 0; i < moduleNames.length; i++ ) {
            writer.plnI("module " + moduleNames[i] + " {");
        }
    } else {
        String packageName = getPackageName();
        if (packageName != null) {
            writer.pln("package " + packageName + ";");
        }
    }
}
 
Example #10
Source File: IDLGenerator.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Write forward references for referenced interfaces and valuetypes
 * ...but not if the reference is to a boxed IDLEntity,
 * @param refHash Hashtable loaded with referenced types
 * @param p The output stream.
 */
protected void writeForwardReferences(
                                      Hashtable refHash,
                                      IndentingWriter p )
    throws IOException {
    Enumeration refEnum = refHash.elements();
    nextReference:
    while ( refEnum.hasMoreElements() ) {
        Type t = (Type)refEnum.nextElement();
        if ( t.isCompound() ) {
            CompoundType ct = (CompoundType)t;
            if ( ct.isIDLEntity() )
                continue nextReference;                  //ignore IDLEntity reference
        }
        writeForwardReference( t,p );
    }
}
 
Example #11
Source File: Type.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Print the "opening" of the package or module of this type.
 * @param writer The stream to print to.
 * @param useIDLNames If true, print IDL names; otherwise, print java names.
 */
protected void printPackageOpen (   IndentingWriter writer,
                                    boolean useIDLNames) throws IOException {

    if (useIDLNames) {
        String[] moduleNames = getIDLModuleNames();
        for (int i = 0; i < moduleNames.length; i++ ) {
            writer.plnI("module " + moduleNames[i] + " {");
        }
    } else {
        String packageName = getPackageName();
        if (packageName != null) {
            writer.pln("package " + packageName + ";");
        }
    }
}
 
Example #12
Source File: ClassType.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Print this type.
 * @param writer The stream to print to.
 * @param useQualifiedNames If true, print qualified names; otherwise, print unqualified names.
 * @param useIDLNames If true, print IDL names; otherwise, print java names.
 * @param globalIDLNames If true and useIDLNames true, prepends "::".
 */
public void print ( IndentingWriter writer,
                    boolean useQualifiedNames,
                    boolean useIDLNames,
                    boolean globalIDLNames) throws IOException {

    if (isInner()) {
        writer.p("// " + getTypeDescription() + " (INNER)");
    } else {
        writer.p("// " + getTypeDescription());
    }
    writer.pln(" (" + getRepositoryID() + ")\n");

    printPackageOpen(writer,useIDLNames);

    if (!useIDLNames) {
        writer.p("public ");
    }

    String prefix = "";
    writer.p("class " + getTypeName(false,useIDLNames,false));
    if (printExtends(writer,useQualifiedNames,useIDLNames,globalIDLNames)) {
        prefix = ",";
    }
    printImplements(writer,prefix,useQualifiedNames,useIDLNames,globalIDLNames);
    writer.plnI(" {");
    printMembers(writer,useQualifiedNames,useIDLNames,globalIDLNames);
    writer.pln();
    printMethods(writer,useQualifiedNames,useIDLNames,globalIDLNames);

    if (useIDLNames) {
        writer.pOln("};");
    } else {
        writer.pOln("}");
    }

    printPackageClose(writer,useIDLNames);
}
 
Example #13
Source File: IDLGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Write a hard-coded IDL typedef definition for the special case
 * java.lang.Object.
 * @param t The current Type
 * @param p The output stream.
 */
protected void writeJavaLangObject(
                                   Type t,
                                   IndentingWriter p )
    throws IOException {
    writeBanner( t,0,!isException,p );
    writeIfndef( t,0,!isException,!isForward,p );
    writeModule1( t,p );
    p.pln();p.pI();
    p.pln( "typedef any _Object;" );
    p.pO();p.pln();
    writeModule2( t,p );
    writeEndif( p );
}
 
Example #14
Source File: Type.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Print the "closing" of the package or module of this type.
 * @param writer The stream to print to.
 * @param useIDLNames If true, print IDL names; otherwise, print java names.
 */
protected void printPackageClose (  IndentingWriter writer,
                                    boolean useIDLNames) throws IOException {
    if (useIDLNames) {
        String[] moduleNames = getIDLModuleNames();
        for (int i = 0; i < moduleNames.length; i++ ) {
            writer.pOln("};");
        }
    }
}
 
Example #15
Source File: IDLGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Write an IDL interface definition for either:
 * 1) a conforming Java remote interface (RemoteType)..or
 * 2) a non-conforming Java interface whose methods all throw
 *     java.rmi.RemoteException (AbstractType)
 * @param t The current RemoteType
 * @param p The output stream.
 */
protected void writeRemote(
                           RemoteType t,
                           IndentingWriter p )
    throws IOException {
    Vector conVec = getConstants( t );                      //collect constants
    Vector mthVec = getMethods( t );                          //collect methods
    Hashtable inhHash = new Hashtable();
    Hashtable refHash = new Hashtable();
    Hashtable spcHash = new Hashtable();
    Hashtable arrHash = new Hashtable();
    Hashtable excHash = new Hashtable();
    getInterfaces( t,inhHash );                            //collect interfaces
    getMethodReferences( mthVec,refHash,spcHash,arrHash,excHash );

    writeProlog( t,refHash,spcHash,arrHash,excHash,inhHash,p );
    writeModule1( t,p );
    p.pln();p.pI();
    if ( t.getTypeCode() == TYPE_ABSTRACT ) p.p( "abstract " );
    p.p( "interface " + t.getIDLName() );
    writeInherits( inhHash,!forValuetype,p );

    p.pln( " {" );
    if ( conVec.size() + mthVec.size() > 0 ) {      //any constants or methods?
        p.pln();p.pI();
        for ( int i1 = 0; i1 < conVec.size(); i1++ )                  //constants
            writeConstant( (CompoundType.Member)conVec.elementAt( i1 ),p );
        for ( int i1 = 0; i1 < mthVec.size(); i1++ )        //methods, attributes
            writeMethod( (CompoundType.Method)mthVec.elementAt( i1 ),p );
        p.pO();p.pln();
    }
    p.pln( "};" );

    p.pO();p.pln();
    writeRepositoryID ( t,p );
    p.pln();
    writeModule2( t,p );
    writeEpilog( t,refHash,p );
}
 
Example #16
Source File: IDLGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Write a hard-coded IDL typedef definition for the special case
 * org.omg.CORBA.portable.IDLEntity
 * @param t The current Type
 * @param p The output stream.
 */
protected void writeIDLEntity(
                              Type t,
                              IndentingWriter p )
    throws IOException {
    writeBanner( t,0,!isException,p );
    writeIfndef( t,0,!isException,!isForward,p );
    writeModule1( t,p );
    p.pln();p.pI();
    p.pln( "typedef any IDLEntity;" );
    p.pO();p.pln();
    writeModule2( t,p );
    writeEndif( p );
}
 
Example #17
Source File: StubGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void write_tie__ids_method(IndentingWriter p)
    throws IOException
{
    if(POATie){
    p.plnI("public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectId){");
    p.pln("return (String[]) _type_ids.clone();");
    p.pOln("}");
    } else {
    p.plnI("public String[] _ids() { ");
    p.pln("return (String[]) _type_ids.clone();");
    p.pOln("}");
    }
}
 
Example #18
Source File: IDLGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Write an IDL Attribute
 * @param attr The current CompoundType.Method attribute
 * @param p The output stream.
 */
protected void writeAttribute(
                              CompoundType.Method attr,
                              IndentingWriter p )
    throws IOException {
    if ( attr.getAttributeKind() == ATTRIBUTE_SET ) return;  //use getters only
    Type t = attr.getReturnType();
    if ( !attr.isReadWriteAttribute() ) p.p( "readonly " );
    p.p( "attribute " + getQualifiedIDLName( t ) + " " );
    p.pln( attr.getAttributeName() + ";" );
}
 
Example #19
Source File: IDLGenerator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Write #endif bracket into the output stream
 * @param p The output stream.
 */
protected void writeEndif(
                          IndentingWriter p )
    throws IOException {
    p.pln("#endif");
    p.pln();
}
 
Example #20
Source File: IDLGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Write a hard-coded IDL typedef definition for the special case
 * java.lang.Object.
 * @param t The current Type
 * @param p The output stream.
 */
protected void writeJavaLangObject(
                                   Type t,
                                   IndentingWriter p )
    throws IOException {
    writeBanner( t,0,!isException,p );
    writeIfndef( t,0,!isException,!isForward,p );
    writeModule1( t,p );
    p.pln();p.pI();
    p.pln( "typedef any _Object;" );
    p.pO();p.pln();
    writeModule2( t,p );
    writeEndif( p );
}
 
Example #21
Source File: StubGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
void writeIds(IndentingWriter p, CompoundType theType, boolean isTie
              ) throws IOException {
    p.plnI("private static final String[] _type_ids = {");

    String[] ids = getAllRemoteRepIDs(theType);

    if (ids.length >0 ) {
        for(int i = 0; i < ids.length; i++) {
            if (i > 0)
                p.pln(", ");
            p.p("\"" + ids[i] + "\"");
        }
    } else {
       // Must be an implementation which only implements Remote...
       p.pln("\"\"");
    }
    String qname = theType.getQualifiedName() ;
    boolean isTransactional = isTie && transactionalObjects.containsKey( qname ) ;
    // Add TransactionalObject if needed.
    if (isTransactional) {
        // Have already written an id.
        p.pln( ", " ) ;
        p.pln( "\"IDL:omg.org/CosTransactions/TransactionalObject:1.0\"" ) ;
    } else if (ids.length > 0) {
        p.pln();
    }
    p.pOln("};");
}
 
Example #22
Source File: Type.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Print the name of this type.
 * @param writer The stream to print to.
 * @param useQualifiedNames If true, print qualified names; otherwise, print unqualified names.
 * @param useIDLNames If true, print IDL names; otherwise, print java names.
 * @param globalIDLNames If true and useIDLNames true, prepends "::".
 */
public void printTypeName ( IndentingWriter writer,
                            boolean useQualifiedNames,
                            boolean useIDLNames,
                            boolean globalIDLNames) throws IOException {

    writer.p(getTypeName(useQualifiedNames,useIDLNames,globalIDLNames));
}
 
Example #23
Source File: StubGenerator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
void writeCastArray(IndentingWriter p) throws IOException {
    if (castArray) {
        p.pln();
        p.pln("// This method is required as a work-around for");
        p.pln("// a bug in the JDK 1.1.6 verifier.");
        p.pln();
        p.plnI("private "+getName(idJavaIoSerializable)+" cast_array(Object obj) {");
        p.pln("return ("+getName(idJavaIoSerializable)+")obj;");
        p.pOln("}");
    }
}
 
Example #24
Source File: InterfaceType.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Print this type.
 * @param writer The stream to print to.
 * @param useQualifiedNames If true, print qualified names; otherwise, print unqualified names.
 * @param useIDLNames If true, print IDL names; otherwise, print java names.
 * @param globalIDLNames If true and useIDLNames true, prepends "::".
 */
public void print ( IndentingWriter writer,
                    boolean useQualifiedNames,
                    boolean useIDLNames,
                    boolean globalIDLNames) throws IOException {

    if (isInner()) {
        writer.p("// " + getTypeDescription() + " (INNER)");
    } else {
        writer.p("// " + getTypeDescription() + "");
    }
    writer.pln(" (" + getRepositoryID() + ")\n");
    printPackageOpen(writer,useIDLNames);

    if (!useIDLNames) {
        writer.p("public ");
    }

    writer.p("interface " + getTypeName(false,useIDLNames,false));
    printImplements(writer,"",useQualifiedNames,useIDLNames,globalIDLNames);
    writer.plnI(" {");
    printMembers(writer,useQualifiedNames,useIDLNames,globalIDLNames);
    writer.pln();
    printMethods(writer,useQualifiedNames,useIDLNames,globalIDLNames);
    writer.pln();

    if (useIDLNames) {
        writer.pOln("};");
    } else {
        writer.pOln("}");
    }
    printPackageClose(writer,useIDLNames);
}
 
Example #25
Source File: Type.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Print this type, followed by a newline.
 * @param writer The stream to print to.
 * @param useQualifiedNames If true, print qualified names; otherwise, print unqualified names.
 * @param useIDLNames If true, print IDL names; otherwise, print java names.
 * @param globalIDLNames If true and useIDLNames true, prepends "::".
 */
public void println (       IndentingWriter writer,
                            boolean useQualifiedNames,
                            boolean useIDLNames,
                            boolean globalIDLNames) throws IOException  {

    print(writer,useQualifiedNames,useIDLNames,globalIDLNames);
    writer.pln();
}
 
Example #26
Source File: IDLGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Write a hard-coded IDL typedef definition for the special case
 * java.io.Externalizable.
 * @param t The current Type
 * @param p The output stream.
 */
protected void writeJavaIoExternalizable(
                                         Type t,
                                         IndentingWriter p )
    throws IOException {
    writeBanner( t,0,!isException,p );
    writeIfndef( t,0,!isException,!isForward,p );
    writeModule1( t,p );
    p.pln();p.pI();
    p.pln( "typedef any Externalizable;" );
    p.pO();p.pln();
    writeModule2( t,p );
    writeEndif( p );
}
 
Example #27
Source File: IDLGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Write valuetype for a boxed IDLEntity.
 * @param t Given CompoundType representing the IDLEntity.
 * @param p The output stream.
 */
protected void writeBoxedIDL(
                             CompoundType t,
                             IndentingWriter p)
    throws IOException {
    String[] boxNames = getIDLModuleNames( t );
    int len = boxNames.length;
    String[] modNames = new String[len - 3];               //remove box modules
    for ( int i1 = 0; i1 < len - 3; i1++ ) modNames[i1] = boxNames[i1 + 3];
    String tName = unEsc( t.getIDLName() );

    writeBanner( t,0,!isException,p );
    writeInclude( t,modNames,tName,p );
    writeIfndef( t,0,!isException,!isForward,p );
    writeModule1( t,p );
    p.pln();p.pI();

    p.p( "valuetype " + tName + " " );
    for ( int i1 = 0; i1 < modNames.length; i1++ )
        p.p( IDL_NAME_SEPARATOR + modNames[i1] );
    p.pln( IDL_NAME_SEPARATOR + tName + ";" );

    p.pO();p.pln();
    writeRepositoryID( t,p );
    p.pln();
    writeModule2( t,p );
    writeEndif( p );
    }
 
Example #28
Source File: IDLGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Write #endif bracket into the output stream
 * @param p The output stream.
 */
protected void writeEndif(
                          IndentingWriter p )
    throws IOException {
    p.pln("#endif");
    p.pln();
}
 
Example #29
Source File: StubGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void allocateResult (IndentingWriter p,
                     Type returnType) throws IOException {
    if (!returnType.isType(TYPE_VOID)) {
        String objName = testUtil(getName(returnType), returnType);
        p.p(objName + " result = ");
    }
}
 
Example #30
Source File: Type.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Print all types referenced directly or indirectly by this type which
 * match the filter.
 * @param writer The stream to print to.
 * @param typeCodeFilter The type codes to print.
 * @param useQualifiedNames If true, print qualified names; otherwise, print unqualified names.
 * @param useIDLNames If true, print IDL names; otherwise, print java names.
 * @param globalIDLNames If true and useIDLNames true, prepends "::".
 */
public void print ( IndentingWriter writer,
                    int typeCodeFilter,
                    boolean useQualifiedNames,
                    boolean useIDLNames,
                    boolean globalIDLNames) throws IOException {

    Type[] theTypes = collectMatching(typeCodeFilter);
    print(writer,theTypes,useQualifiedNames,useIDLNames,globalIDLNames);
}