当前位置: 首页>>代码示例>>Java>>正文


Java IndentingWriter.pln方法代码示例

本文整理汇总了Java中sun.rmi.rmic.IndentingWriter.pln方法的典型用法代码示例。如果您正苦于以下问题:Java IndentingWriter.pln方法的具体用法?Java IndentingWriter.pln怎么用?Java IndentingWriter.pln使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.rmi.rmic.IndentingWriter的用法示例。


在下文中一共展示了IndentingWriter.pln方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write_tie_deactivate_method

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
public void write_tie_deactivate_method(IndentingWriter p)
    throws IOException
{
    if(POATie){
        p.plnI("public void deactivate() {");
        p.pln("try{");
        p.pln("_poa().deactivate_object(_poa().servant_to_id(this));");
        p.pln("}catch (org.omg.PortableServer.POAPackage.WrongPolicy exception){");
        catchWrongPolicy(p);
        p.pln("}catch (org.omg.PortableServer.POAPackage.ObjectNotActive exception){");
        catchObjectNotActive(p);
        p.pln("}catch (org.omg.PortableServer.POAPackage.ServantNotActive exception){");
        catchServantNotActive(p);
        p.pln("}");
        p.pOln("}");
    } else {
        p.plnI("public void deactivate() {");
        p.pln("_orb().disconnect(this);");
        p.pln("_set_delegate(null);");
        p.pln("target = null;");
        p.pOln("}");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:StubGenerator.java

示例2: writeForwardReference

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
/**
 * 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 );
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:IDLGenerator.java

示例3: writeImplementation

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
/**
 * 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 );
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:IDLGenerator.java

示例4: writeException

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
/**
 * 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 );
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:IDLGenerator.java

示例5: writeNCType

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
/**
 * Write an IDL valuetype definition for
 * 1) a nonconforming Java class
 * 2) a nonconforming Java interface (that is not an AbstractType)
 * @param t The current NC Type (NCClassType or NCInterfaceType)
 * @param p The output stream.
 */
protected void writeNCType(
                           CompoundType 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
    getInheritance( t,inhHash );                              //add inheritance
    getMethodReferences( mthVec,refHash,spcHash,arrHash,excHash );

    writeProlog( t,refHash,spcHash,arrHash,excHash,inhHash,p );
    writeModule1( t,p );
    p.pln();p.pI();
    p.p( "abstract valuetype " + t.getIDLName() );
    writeInherits( inhHash,!forValuetype,p );

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

            p.pO();p.pln();
    writeModule2( t,p );
    writeEpilog( t,refHash,p );
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:44,代码来源:IDLGenerator.java

示例6: writeCastArray

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
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("}");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:StubGenerator.java

示例7: writeJavaIoExternalizable

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
/**
 * 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 );
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:IDLGenerator.java

示例8: writeJavaLangObject

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
/**
 * 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 );
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:IDLGenerator.java

示例9: writeJavaRmiRemote

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
/**
 * Write a hard-coded IDL typedef definition for the special case
 * java.rmi.Remote.
 * @param t The current Type
 * @param p The output stream.
 */
protected void writeJavaRmiRemote(
                                  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 Object Remote;" );
    p.pO();p.pln();
    writeModule2( t,p );
    writeEndif( p );
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:IDLGenerator.java

示例10: writeIDLEntity

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
/**
 * 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 );
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:IDLGenerator.java

示例11: writeModule2

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
/**
 * Write Module end bracketing for the given type into the output stream
 * @param t The given Type
 * @param p The output stream.
 */
protected void writeModule2(
                            Type t,
                            IndentingWriter p )
    throws IOException {
    String[] modNames = getIDLModuleNames( t );
    for ( int i=0; i < modNames.length; i++ ) p.pln( "};" );
    p.pln();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:IDLGenerator.java

示例12: writeIfndef

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
/**
 * Write #ifndef guard into the output stream for a given Type
 * @param t The given Type.
 * @param dim The dimension required if t is an ArrayType.
 * @param isException true if writing an exception.
 * @param isForward. No #define needed if it's a forward declare
 * @param p The output stream.
 */
protected void writeIfndef(
                           Type t,
                           int dim,
                           boolean isException,
                           boolean isForward,
                           IndentingWriter p )
    throws IOException {
    String[] modNames = getIDLModuleNames( t );             //module name array
    String fName = unEsc( t.getIDLName() );                 //file name default
    if ( isException && t.isClass() ) {
        ClassType ct = (ClassType)t;                    //file name for Exception
        fName = unEsc( ct.getIDLExceptionName() );
    }
    if ( dim > 0 && t.isArray() ) {
        Type et = t.getElementType();                    //file name for sequence
        fName = "seq" + dim + "_" + unEsc( et.getIDLName().replace( ' ','_' ) );
    }
    p.pln();
    p.p( "#ifndef __" );
    for ( int i = 0; i < modNames.length; i++ ) p.p( modNames[i] + "_" );
    p.pln( fName + "__" );
    if ( !isForward ) {
    p.p( "#define __" );
    for ( int i = 0; i < modNames.length; i++ ) p.p( modNames[i] + "_" );
        p.pln( fName + "__" );
        p.pln();
}
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:37,代码来源:IDLGenerator.java

示例13: writeIds

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
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("};");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:StubGenerator.java

示例14: writeRemote

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
/**
 * 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 );
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:47,代码来源:IDLGenerator.java

示例15: print

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:40,代码来源:InterfaceType.java


注:本文中的sun.rmi.rmic.IndentingWriter.pln方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。