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


Java IndentingWriter.plnI方法代码示例

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


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

示例1: printPackageOpen

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

示例2: write_tie_thisObject_method

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
public void write_tie_thisObject_method(IndentingWriter p,
                                        Identifier idCorbaObject)
    throws IOException
{
    if(POATie){
        p.plnI("public " + idCorbaObject + " thisObject() {");
        /*
        p.pln("org.omg.CORBA.Object objref = null;");
        p.pln("try{");
        p.pln("objref = _poa().servant_to_reference(this);");
        p.pln("}catch (org.omg.PortableServer.POAPackage.WrongPolicy exception){");
        catchWrongPolicy(p);
        p.pln("}catch (org.omg.PortableServer.POAPackage.ServantNotActive exception){");
        catchServantNotActive(p);
        p.pln("}");
        p.pln("return objref;");
        */
        p.pln("return _this_object();");
        p.pOln("}");
    } else {
        p.plnI("public " + idCorbaObject + " thisObject() {");
        p.pln("return this;");
        p.pOln("}");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:StubGenerator.java

示例3: 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:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:StubGenerator.java

示例4: 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 ");
    }

    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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:45,代码来源:ClassType.java

示例5: 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

示例6: 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

示例7: write_tie_orb_method

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
public void write_tie_orb_method(IndentingWriter p)
    throws IOException
{
    if(POATie){
    p.plnI("public void orb(ORB orb) {");
    /*
    p.pln("try{");
    p.pln("orb.connect(_poa().servant_to_reference(this));");
    p.pln("}catch (org.omg.PortableServer.POAPackage.WrongPolicy exception){");
    catchWrongPolicy(p);
    p.pln("}catch (org.omg.PortableServer.POAPackage.ServantNotActive exception){");
    catchServantNotActive(p);
    p.pln("}");
    */
    p.pln("try {");
    p.pln("    ((org.omg.CORBA_2_3.ORB)orb).set_delegate(this);");
    p.pln("}");
    p.pln("catch(ClassCastException e) {");
    p.pln("    throw new org.omg.CORBA.BAD_PARAM");
    p.pln("        (\"POA Servant requires an instance of org.omg.CORBA_2_3.ORB\");");
    p.pln("}");
    p.pOln("}");
    } else {
    p.plnI("public void orb(ORB orb) {");
    p.pln("orb.connect(this);");
    p.pOln("}");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:StubGenerator.java

示例8: write_tie__ids_method

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

示例9: 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:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:InterfaceType.java

示例10: writeStubMethod

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
void writeStubMethod (  IndentingWriter p,
                        CompoundType.Method method,
                        CompoundType theType) throws IOException {

    // Wtite the method declaration and opening brace...
    String methodName = method.getName();
    String methodIDLName = method.getIDLName();

    Type paramTypes[] = method.getArguments();
    String paramNames[] = method.getArgumentNames();
    Type returnType = method.getReturnType();
    ValueType[] exceptions = getStubExceptions(method,false);

    addNamesInUse(method);
    addNameInUse("_type_ids");

    String objName = testUtil(getName(returnType), returnType);
    p.p("public " + objName + " " + methodName + "(");
    for(int i = 0; i < paramTypes.length; i++) {
        if (i > 0)
            p.p(", ");
        p.p(getName(paramTypes[i]) + " " + paramNames[i]);
    }

    p.p(")");
    if (exceptions.length > 0) {
        p.p(" throws ");
        for(int i = 0; i < exceptions.length; i++) {
            if (i > 0) {
                p.p(", ");
            }
            // Added for Bug 4818753
            p.p(getExceptionName(exceptions[i]));
        }
    }

    p.plnI(" {");

    // Now create the method body...

    if (localStubs) {
        writeLocalStubMethodBody(p,method,theType);
    } else {
        writeNonLocalStubMethodBody(p,method,theType);
    }

    // Close out the method...

    p.pOln("}");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:51,代码来源:StubGenerator.java

示例11: writeStubMethod

import sun.rmi.rmic.IndentingWriter; //导入方法依赖的package包/类
void writeStubMethod (  IndentingWriter p,
                        CompoundType.Method method,
                        CompoundType theType) throws IOException {

    // Wtite the method declaration and opening brace...
    String methodName = method.getName();
    String methodIDLName = method.getIDLName();

    Type paramTypes[] = method.getArguments();
    String paramNames[] = method.getArgumentNames();
    Type returnType = method.getReturnType();
    ValueType[] exceptions = getStubExceptions(method,false);
    boolean hasIOException = false;

    addNamesInUse(method);
    addNameInUse("_type_ids");

    String objName = testUtil(getName(returnType), returnType);
    p.p("public " + objName + " " + methodName + "(");
    for(int i = 0; i < paramTypes.length; i++) {
        if (i > 0)
            p.p(", ");
        p.p(getName(paramTypes[i]) + " " + paramNames[i]);
    }

    p.p(")");
    if (exceptions.length > 0) {
        p.p(" throws ");
        for(int i = 0; i < exceptions.length; i++) {
            if (i > 0) {
                p.p(", ");
            }
            // Added for Bug 4818753
            p.p(getExceptionName(exceptions[i]));
        }
    }

    p.plnI(" {");

    // Now create the method body...
    if (emitPermissionCheck) {
        p.pln("if ((System.getSecurityManager() != null) && (!_instantiated)) {");
        p.plnI("    throw new java.io.IOError(new java.io.IOException(\"InvalidObject \"));");
        p.pOln("}");
        p.pln();
    }


    if (localStubs) {
        writeLocalStubMethodBody(p,method,theType);
    } else {
        writeNonLocalStubMethodBody(p,method,theType);
    }

    // Close out the method...

    p.pOln("}");
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:59,代码来源:StubGenerator.java


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