• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IndentingWriter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: writeForwardReferences

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


示例4: writeBoxedRMIIncludes

import sun.rmi.rmic.IndentingWriter; //导入依赖的package包/类
/**
 * Write includes for boxedRMI valuetypes for IDL sequences.
 * Write only the maximum dimension found for an ArrayType.
 * @param arrHash Hashtable loaded with array types
 * @param p The output stream.
 */
protected void writeBoxedRMIIncludes(
                                     Hashtable arrHash,
                                     IndentingWriter p)
    throws IOException {
    Enumeration e1 = arrHash.elements();
    nextSequence:
    while ( e1.hasMoreElements() ) {
        ArrayType at = (ArrayType)e1.nextElement();
        int dim = at.getArrayDimension();
        Type et = at.getElementType();

        Enumeration e2 = arrHash.elements();
        while ( e2.hasMoreElements() ) {                   //eliminate duplicates
            ArrayType at2 = (ArrayType)e2.nextElement();
            if ( et == at2.getElementType() &&                //same element type &
                 dim < at2.getArrayDimension() )               //smaller dimension?
                continue nextSequence;                              //ignore this one
    }
        writeInclude( at,dim,!isThrown,p );
}
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:IDLGenerator.java


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


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


示例7: writeMarshalArguments

import sun.rmi.rmic.IndentingWriter; //导入依赖的package包/类
/**
 * Write Java statements to marshal a series of values in order as
 * named in the "names" array, with types as specified in the "types"
 * array", to the java.io.ObjectOutput stream named "stream".
 */
void writeMarshalArguments(IndentingWriter p,
                           String streamName,
                           Type[] types, String[] names)
    throws IOException
{
    if (types.length != names.length) {
        throw new Error("paramter type and name arrays different sizes");
    }

    for (int i = 0; i < types.length; i++) {
        writeMarshalArgument(p, streamName, types[i], names[i]);
        if (i != types.length -1) {
            p.pln();
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:StubGenerator.java


示例8: 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:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:IDLGenerator.java


示例9: writeProlog

import sun.rmi.rmic.IndentingWriter; //导入依赖的package包/类
/**
 * Write IDL prolog for a CompoundType.
 * @param t The CompoundType.
 * @param refHash Hashtable loaded with type references.
 * @param spcHash Hashtable loaded with special type references.
 * @param arrHash Hashtable loaded with array references.
 * @param excHash Hashtable loaded with exceptions thrown.
 * @param inhHash Hashtable loaded with inherited types.
 * @param p The output stream.
 */
protected void writeProlog(
                           CompoundType t,
                           Hashtable refHash,
                           Hashtable spcHash,
                           Hashtable arrHash,
                           Hashtable excHash,
                           Hashtable inhHash,
                           IndentingWriter p )
    throws IOException {
    writeBanner( t,0,!isException,p );
    writeForwardReferences( refHash,p );
    writeIncludes( excHash,isThrown,p );      //#includes for exceptions thrown
    writeInheritedIncludes( inhHash,p );
    writeIncludes( spcHash,!isThrown,p );         //#includes for special types
    writeBoxedRMIIncludes( arrHash,p );
    writeIDLEntityIncludes( refHash,p );
    writeIncOrb( p );
    writeIfndef( t,0,!isException,!isForward,p );
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:IDLGenerator.java


示例10: writeSpecial

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


示例11: writeIDLEntityIncludes

import sun.rmi.rmic.IndentingWriter; //导入依赖的package包/类
/**
 * Write #includes for boxed IDLEntity references.
 * @param refHash Hashtable loaded with referenced types
 * @param p The output stream.
 */
protected void writeIDLEntityIncludes(
                                      Hashtable refHash,
                                      IndentingWriter p )
    throws IOException {
    Enumeration refEnum = refHash.elements();
    while ( refEnum.hasMoreElements() ) {
        Type t = (Type)refEnum.nextElement();
        if ( t.isCompound() ) {
            CompoundType ct = (CompoundType)t;
            if ( ct.isIDLEntity() ) {                          //select IDLEntities
                writeInclude( ct,0,!isThrown,p );
                refHash.remove( ct.getQualifiedName() );     //avoid another #include
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:IDLGenerator.java


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


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


示例14: printExtends

import sun.rmi.rmic.IndentingWriter; //导入依赖的package包/类
protected boolean printExtends (IndentingWriter writer,
                                boolean useQualifiedNames,
                                boolean useIDLNames,
                                boolean globalIDLNames) throws IOException {

    ClassType parent = getSuperclass();

    if (parent != null && (!useIDLNames ||
                           (!parent.isType(TYPE_ANY) && !parent.isType(TYPE_CORBA_OBJECT)))) {
        writer.p(" extends ");
        parent.printTypeName(writer,useQualifiedNames,useIDLNames,globalIDLNames);
        return true;
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:CompoundType.java


示例15: printTypeName

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


示例16: printMembers

import sun.rmi.rmic.IndentingWriter; //导入依赖的package包/类
protected void printMembers (       IndentingWriter writer,
                                    boolean useQualifiedNames,
                                    boolean useIDLNames,
                                    boolean globalIDLNames) throws IOException {

    CompoundType.Member[] members = getMembers();

    for (int i = 0; i < members.length; i++) {
        if (!members[i].isInnerClassDeclaration()) {
            Type it = members[i].getType();
            String visibility = members[i].getVisibility();
            String name;

            if (useIDLNames) {
                name = members[i].getIDLName();
            } else {
                name = members[i].getName();
            }

            String value = members[i].getValue();

            writer.p(visibility);
            if (visibility.length() > 0) {
                writer.p(" ");
            }
            it.printTypeName(writer,useQualifiedNames,useIDLNames,globalIDLNames);
            writer.p(" " + name);

            if (value != null) {
                writer.pln(" = " + value + ";");
            } else {
                writer.pln(";");
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:CompoundType.java


示例17: printMethods

import sun.rmi.rmic.IndentingWriter; //导入依赖的package包/类
protected void printMethods (       IndentingWriter writer,
                                    boolean useQualifiedNames,
                                    boolean useIDLNames,
                                    boolean globalIDLNames) throws IOException {

    CompoundType.Method[] methods = getMethods();

    for (int m = 0; m < methods.length; m++) {
        CompoundType.Method theMethod = methods[m];
        printMethod(theMethod,writer,useQualifiedNames,useIDLNames,globalIDLNames);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:CompoundType.java


示例18: print

import sun.rmi.rmic.IndentingWriter; //导入依赖的package包/类
/**
 * Print an array of types.
 * @param writer The stream to print to.
 * @param theTypes The types 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 static void print (  IndentingWriter writer,
                            Type[] theTypes,
                            boolean useQualifiedNames,
                            boolean useIDLNames,
                            boolean globalIDLNames) throws IOException {

    for (int i = 0; i < theTypes.length; i++) {
        theTypes[i].println(writer,useQualifiedNames,useIDLNames,globalIDLNames);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:Type.java


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


示例20: writeEpilog

import sun.rmi.rmic.IndentingWriter; //导入依赖的package包/类
/**
 * Write IDL epilog for a CompoundType.
 * @param t The CompoundType.
 * @param refHash Hashtable loaded with type references.
 * @param p The output stream.
 */
protected void writeEpilog(
                           CompoundType t,
                           Hashtable refHash,
                           IndentingWriter p )
    throws IOException {
    writeIncludes( refHash,!isThrown,p );     //#includes for forward dcl types
    writeEndif( p );
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:IDLGenerator.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ProviderInsertSelectiveMethodGenerator类代码示例发布时间:2022-05-22
下一篇:
Java ContainerTerminationContext类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap