Java Code Examples for sun.rmi.rmic.newrmic.IndentingWriter#pln()

The following examples show how to use sun.rmi.rmic.newrmic.IndentingWriter#pln() . 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: StubSkeletonWriter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes the constructors for the stub class.
 **/
private void writeStubConstructors(IndentingWriter p)
    throws IOException
{
    p.pln("// constructors");

    /*
     * Only stubs compatible with the JDK 1.1 stub protocol need
     * a no-arg constructor; later versions use reflection to find
     * the constructor that directly takes a RemoteRef argument.
     */
    if (version == StubVersion.V1_1 ||
        version == StubVersion.VCOMPAT)
    {
        p.plnI("public " + stubClassSimpleName + "() {");
        p.pln("super();");
        p.pOln("}");
    }

    p.plnI("public " + stubClassSimpleName + "(" + REMOTE_REF + " ref) {");
    p.pln("super(ref);");
    p.pOln("}");
}
 
Example 2
Source File: StubSkeletonWriter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes the constructors for the stub class.
 **/
private void writeStubConstructors(IndentingWriter p)
    throws IOException
{
    p.pln("// constructors");

    /*
     * Only stubs compatible with the JDK 1.1 stub protocol need
     * a no-arg constructor; later versions use reflection to find
     * the constructor that directly takes a RemoteRef argument.
     */
    if (version == StubVersion.V1_1 ||
        version == StubVersion.VCOMPAT)
    {
        p.plnI("public " + stubClassSimpleName + "() {");
        p.pln("super();");
        p.pOln("}");
    }

    p.plnI("public " + stubClassSimpleName + "(" + REMOTE_REF + " ref) {");
    p.pln("super(ref);");
    p.pOln("}");
}
 
Example 3
Source File: StubSkeletonWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes code to initialize the static fields for each method
 * using the Java Reflection API.
 **/
private void writeMethodFieldInitializers(IndentingWriter p)
    throws IOException
{
    for (int i = 0; i < methodFieldNames.length; i++) {
        p.p(methodFieldNames[i] + " = ");
        /*
         * Look up the Method object in the somewhat arbitrary
         * interface that we find in the Method object.
         */
        RemoteClass.Method method = remoteMethods[i];
        MethodDoc methodDoc = method.methodDoc();
        String methodName = methodDoc.name();
        Type paramTypes[] = method.parameterTypes();

        p.p(methodDoc.containingClass().qualifiedName() + ".class.getMethod(\"" +
            methodName + "\", new java.lang.Class[] {");
        for (int j = 0; j < paramTypes.length; j++) {
            if (j > 0)
                p.p(", ");
            p.p(paramTypes[j].toString() + ".class");
        }
        p.pln("});");
    }
}
 
Example 4
Source File: StubSkeletonWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes the constructors for the stub class.
 **/
private void writeStubConstructors(IndentingWriter p)
    throws IOException
{
    p.pln("// constructors");

    /*
     * Only stubs compatible with the JDK 1.1 stub protocol need
     * a no-arg constructor; later versions use reflection to find
     * the constructor that directly takes a RemoteRef argument.
     */
    if (version == StubVersion.V1_1 ||
        version == StubVersion.VCOMPAT)
    {
        p.plnI("public " + stubClassSimpleName + "() {");
        p.pln("super();");
        p.pOln("}");
    }

    p.plnI("public " + stubClassSimpleName + "(" + REMOTE_REF + " ref) {");
    p.pln("super(ref);");
    p.pOln("}");
}
 
Example 5
Source File: StubSkeletonWriter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes the constructors for the stub class.
 **/
private void writeStubConstructors(IndentingWriter p)
    throws IOException
{
    p.pln("// constructors");

    /*
     * Only stubs compatible with the JDK 1.1 stub protocol need
     * a no-arg constructor; later versions use reflection to find
     * the constructor that directly takes a RemoteRef argument.
     */
    if (version == StubVersion.V1_1 ||
        version == StubVersion.VCOMPAT)
    {
        p.plnI("public " + stubClassSimpleName + "() {");
        p.pln("super();");
        p.pOln("}");
    }

    p.plnI("public " + stubClassSimpleName + "(" + REMOTE_REF + " ref) {");
    p.pln("super(ref);");
    p.pOln("}");
}
 
Example 6
Source File: StubSkeletonWriter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes the constructors for the stub class.
 **/
private void writeStubConstructors(IndentingWriter p)
    throws IOException
{
    p.pln("// constructors");

    /*
     * Only stubs compatible with the JDK 1.1 stub protocol need
     * a no-arg constructor; later versions use reflection to find
     * the constructor that directly takes a RemoteRef argument.
     */
    if (version == StubVersion.V1_1 ||
        version == StubVersion.VCOMPAT)
    {
        p.plnI("public " + stubClassSimpleName + "() {");
        p.pln("super();");
        p.pOln("}");
    }

    p.plnI("public " + stubClassSimpleName + "(" + REMOTE_REF + " ref) {");
    p.pln("super(ref);");
    p.pOln("}");
}
 
Example 7
Source File: StubSkeletonWriter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes code to initialize the static fields for each method
 * using the Java Reflection API.
 **/
private void writeMethodFieldInitializers(IndentingWriter p)
    throws IOException
{
    for (int i = 0; i < methodFieldNames.length; i++) {
        p.p(methodFieldNames[i] + " = ");
        /*
         * Look up the Method object in the somewhat arbitrary
         * interface that we find in the Method object.
         */
        RemoteClass.Method method = remoteMethods[i];
        MethodDoc methodDoc = method.methodDoc();
        String methodName = methodDoc.name();
        Type paramTypes[] = method.parameterTypes();

        p.p(methodDoc.containingClass().qualifiedName() + ".class.getMethod(\"" +
            methodName + "\", new java.lang.Class[] {");
        for (int j = 0; j < paramTypes.length; j++) {
            if (j > 0)
                p.p(", ");
            p.p(paramTypes[j].toString() + ".class");
        }
        p.pln("});");
    }
}
 
Example 8
Source File: StubSkeletonWriter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration and initializer for "operations" static array.
 **/
private void writeOperationsArray(IndentingWriter p)
    throws IOException
{
    p.plnI("private static final " + OPERATION + "[] operations = {");
    for (int i = 0; i < remoteMethods.length; i++) {
        if (i > 0)
            p.pln(",");
        p.p("new " + OPERATION + "(\"" +
            remoteMethods[i].operationString() + "\")");
    }
    p.pln();
    p.pOln("};");
}
 
Example 9
Source File: StubSkeletonWriter.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration and initializer for "operations" static array.
 **/
private void writeOperationsArray(IndentingWriter p)
    throws IOException
{
    p.plnI("private static final " + OPERATION + "[] operations = {");
    for (int i = 0; i < remoteMethods.length; i++) {
        if (i > 0)
            p.pln(",");
        p.p("new " + OPERATION + "(\"" +
            remoteMethods[i].operationString() + "\")");
    }
    p.pln();
    p.pOln("};");
}
 
Example 10
Source File: StubSkeletonWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration for java.lang.reflect.Method static fields
 * corresponding to each remote method in a stub.
 **/
private void writeMethodFieldDeclarations(IndentingWriter p)
    throws IOException
{
    for (String name : methodFieldNames) {
        p.pln("private static java.lang.reflect.Method " + name + ";");
    }
}
 
Example 11
Source File: StubSkeletonWriter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration and initializer for "interfaceHash" static field.
 **/
private void writeInterfaceHash(IndentingWriter p)
    throws IOException
{
    p.pln("private static final long interfaceHash = " +
        remoteClass.interfaceHash() + "L;");
}
 
Example 12
Source File: StubSkeletonWriter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration for java.lang.reflect.Method static fields
 * corresponding to each remote method in a stub.
 **/
private void writeMethodFieldDeclarations(IndentingWriter p)
    throws IOException
{
    for (String name : methodFieldNames) {
        p.pln("private static java.lang.reflect.Method " + name + ";");
    }
}
 
Example 13
Source File: StubSkeletonWriter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration and initializer for "operations" static array.
 **/
private void writeOperationsArray(IndentingWriter p)
    throws IOException
{
    p.plnI("private static final " + OPERATION + "[] operations = {");
    for (int i = 0; i < remoteMethods.length; i++) {
        if (i > 0)
            p.pln(",");
        p.p("new " + OPERATION + "(\"" +
            remoteMethods[i].operationString() + "\")");
    }
    p.pln();
    p.pOln("};");
}
 
Example 14
Source File: StubSkeletonWriter.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration and initializer for "interfaceHash" static field.
 **/
private void writeInterfaceHash(IndentingWriter p)
    throws IOException
{
    p.pln("private static final long interfaceHash = " +
        remoteClass.interfaceHash() + "L;");
}
 
Example 15
Source File: StubSkeletonWriter.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration and initializer for "interfaceHash" static field.
 **/
private void writeInterfaceHash(IndentingWriter p)
    throws IOException
{
    p.pln("private static final long interfaceHash = " +
        remoteClass.interfaceHash() + "L;");
}
 
Example 16
Source File: StubSkeletonWriter.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration and initializer for "operations" static array.
 **/
private void writeOperationsArray(IndentingWriter p)
    throws IOException
{
    p.plnI("private static final " + OPERATION + "[] operations = {");
    for (int i = 0; i < remoteMethods.length; i++) {
        if (i > 0)
            p.pln(",");
        p.p("new " + OPERATION + "(\"" +
            remoteMethods[i].operationString() + "\")");
    }
    p.pln();
    p.pOln("};");
}
 
Example 17
Source File: StubSkeletonWriter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration and initializer for "interfaceHash" static field.
 **/
private void writeInterfaceHash(IndentingWriter p)
    throws IOException
{
    p.pln("private static final long interfaceHash = " +
        remoteClass.interfaceHash() + "L;");
}
 
Example 18
Source File: StubSkeletonWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration and initializer for "operations" static array.
 **/
private void writeOperationsArray(IndentingWriter p)
    throws IOException
{
    p.plnI("private static final " + OPERATION + "[] operations = {");
    for (int i = 0; i < remoteMethods.length; i++) {
        if (i > 0)
            p.pln(",");
        p.p("new " + OPERATION + "(\"" +
            remoteMethods[i].operationString() + "\")");
    }
    p.pln();
    p.pOln("};");
}
 
Example 19
Source File: StubSkeletonWriter.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration and initializer for "interfaceHash" static field.
 **/
private void writeInterfaceHash(IndentingWriter p)
    throws IOException
{
    p.pln("private static final long interfaceHash = " +
        remoteClass.interfaceHash() + "L;");
}
 
Example 20
Source File: StubSkeletonWriter.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes declaration for java.lang.reflect.Method static fields
 * corresponding to each remote method in a stub.
 **/
private void writeMethodFieldDeclarations(IndentingWriter p)
    throws IOException
{
    for (String name : methodFieldNames) {
        p.pln("private static java.lang.reflect.Method " + name + ";");
    }
}