sun.rmi.rmic.newrmic.IndentingWriter Java Examples

The following examples show how to use sun.rmi.rmic.newrmic.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: StubSkeletonWriter.java    From openjdk-8 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 openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes Java statements to unmarshal a series of values in order
 * of types as in the "types" array from the java.io.ObjectInput
 * stream named "stream" into variables as named in "names" (for
 * any element of "names" that is null, the corresponding value is
 * unmarshalled and discarded).
 **/
private static boolean writeUnmarshalArguments(IndentingWriter p,
                                               String streamName,
                                               Type[] types,
                                               String[] names)
    throws IOException
{
    assert types.length == names.length;

    boolean readObject = false;
    for (int i = 0; i < types.length; i++) {
        if (writeUnmarshalArgument(p, streamName, types[i], names[i])) {
            readObject = true;
        }
        p.pln(";");
    }
    return readObject;
}
 
Example #3
Source File: StubSkeletonWriter.java    From openjdk-jdk9 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 #4
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 #5
Source File: StubSkeletonWriter.java    From TencentKona-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 #6
Source File: StubSkeletonWriter.java    From jdk8u-dev-jdk 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 #7
Source File: StubSkeletonWriter.java    From TencentKona-8 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 #8
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 #9
Source File: StubSkeletonWriter.java    From dragonwell8_jdk 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 #10
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 #11
Source File: StubSkeletonWriter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes Java statements to unmarshal a series of values in order
 * of types as in the "types" array from the java.io.ObjectInput
 * stream named "stream" into variables as named in "names" (for
 * any element of "names" that is null, the corresponding value is
 * unmarshalled and discarded).
 **/
private static boolean writeUnmarshalArguments(IndentingWriter p,
                                               String streamName,
                                               Type[] types,
                                               String[] names)
    throws IOException
{
    assert types.length == names.length;

    boolean readObject = false;
    for (int i = 0; i < types.length; i++) {
        if (writeUnmarshalArgument(p, streamName, types[i], names[i])) {
            readObject = true;
        }
        p.pln(";");
    }
    return readObject;
}
 
Example #12
Source File: StubSkeletonWriter.java    From jdk8u_jdk 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 #13
Source File: StubSkeletonWriter.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes Java statements to unmarshal a series of values in order
 * of types as in the "types" array from the java.io.ObjectInput
 * stream named "stream" into variables as named in "names" (for
 * any element of "names" that is null, the corresponding value is
 * unmarshalled and discarded).
 **/
private static boolean writeUnmarshalArguments(IndentingWriter p,
                                               String streamName,
                                               Type[] types,
                                               String[] names)
    throws IOException
{
    assert types.length == names.length;

    boolean readObject = false;
    for (int i = 0; i < types.length; i++) {
        if (writeUnmarshalArgument(p, streamName, types[i], names[i])) {
            readObject = true;
        }
        p.pln(";");
    }
    return readObject;
}
 
Example #14
Source File: StubSkeletonWriter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes Java statements to unmarshal a series of values in order
 * of types as in the "types" array from the java.io.ObjectInput
 * stream named "stream" into variables as named in "names" (for
 * any element of "names" that is null, the corresponding value is
 * unmarshalled and discarded).
 **/
private static boolean writeUnmarshalArguments(IndentingWriter p,
                                               String streamName,
                                               Type[] types,
                                               String[] names)
    throws IOException
{
    assert types.length == names.length;

    boolean readObject = false;
    for (int i = 0; i < types.length; i++) {
        if (writeUnmarshalArgument(p, streamName, types[i], names[i])) {
            readObject = true;
        }
        p.pln(";");
    }
    return readObject;
}
 
Example #15
Source File: StubSkeletonWriter.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes Java statements to unmarshal a series of values in order
 * of types as in the "types" array from the java.io.ObjectInput
 * stream named "stream" into variables as named in "names" (for
 * any element of "names" that is null, the corresponding value is
 * unmarshalled and discarded).
 **/
private static boolean writeUnmarshalArguments(IndentingWriter p,
                                               String streamName,
                                               Type[] types,
                                               String[] names)
    throws IOException
{
    assert types.length == names.length;

    boolean readObject = false;
    for (int i = 0; i < types.length; i++) {
        if (writeUnmarshalArgument(p, streamName, types[i], names[i])) {
            readObject = true;
        }
        p.pln(";");
    }
    return readObject;
}
 
Example #16
Source File: StubSkeletonWriter.java    From dragonwell8_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 #17
Source File: StubSkeletonWriter.java    From jdk8u-jdk 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 #18
Source File: StubSkeletonWriter.java    From jdk8u60 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 #19
Source File: StubSkeletonWriter.java    From hottub 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 #20
Source File: StubSkeletonWriter.java    From jdk8u-dev-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 #21
Source File: StubSkeletonWriter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes Java statements to unmarshal a series of values in order
 * of types as in the "types" array from the java.io.ObjectInput
 * stream named "stream" into variables as named in "names" (for
 * any element of "names" that is null, the corresponding value is
 * unmarshalled and discarded).
 **/
private static boolean writeUnmarshalArguments(IndentingWriter p,
                                               String streamName,
                                               Type[] types,
                                               String[] names)
    throws IOException
{
    assert types.length == names.length;

    boolean readObject = false;
    for (int i = 0; i < types.length; i++) {
        if (writeUnmarshalArgument(p, streamName, types[i], names[i])) {
            readObject = true;
        }
        p.pln(";");
    }
    return readObject;
}
 
Example #22
Source File: StubSkeletonWriter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes Java statements to unmarshal a series of values in order
 * of types as in the "types" array from the java.io.ObjectInput
 * stream named "stream" into variables as named in "names" (for
 * any element of "names" that is null, the corresponding value is
 * unmarshalled and discarded).
 **/
private static boolean writeUnmarshalArguments(IndentingWriter p,
                                               String streamName,
                                               Type[] types,
                                               String[] names)
    throws IOException
{
    assert types.length == names.length;

    boolean readObject = false;
    for (int i = 0; i < types.length; i++) {
        if (writeUnmarshalArgument(p, streamName, types[i], names[i])) {
            readObject = true;
        }
        p.pln(";");
    }
    return readObject;
}
 
Example #23
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 #24
Source File: StubSkeletonWriter.java    From openjdk-jdk8u-backup 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 #25
Source File: StubSkeletonWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes Java statements to unmarshal a series of values in order
 * of types as in the "types" array from the java.io.ObjectInput
 * stream named "stream" into variables as named in "names" (for
 * any element of "names" that is null, the corresponding value is
 * unmarshalled and discarded).
 **/
private static boolean writeUnmarshalArguments(IndentingWriter p,
                                               String streamName,
                                               Type[] types,
                                               String[] names)
    throws IOException
{
    assert types.length == names.length;

    boolean readObject = false;
    for (int i = 0; i < types.length; i++) {
        if (writeUnmarshalArgument(p, streamName, types[i], names[i])) {
            readObject = true;
        }
        p.pln(";");
    }
    return readObject;
}
 
Example #26
Source File: StubSkeletonWriter.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes Java statements to unmarshal a series of values in order
 * of types as in the "types" array from the java.io.ObjectInput
 * stream named "stream" into variables as named in "names" (for
 * any element of "names" that is null, the corresponding value is
 * unmarshalled and discarded).
 **/
private static boolean writeUnmarshalArguments(IndentingWriter p,
                                               String streamName,
                                               Type[] types,
                                               String[] names)
    throws IOException
{
    assert types.length == names.length;

    boolean readObject = false;
    for (int i = 0; i < types.length; i++) {
        if (writeUnmarshalArgument(p, streamName, types[i], names[i])) {
            readObject = true;
        }
        p.pln(";");
    }
    return readObject;
}
 
Example #27
Source File: StubSkeletonWriter.java    From openjdk-jdk8u 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 #28
Source File: StubSkeletonWriter.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Writes Java statements to unmarshal a series of values in order
 * of types as in the "types" array from the java.io.ObjectInput
 * stream named "stream" into variables as named in "names" (for
 * any element of "names" that is null, the corresponding value is
 * unmarshalled and discarded).
 **/
private static boolean writeUnmarshalArguments(IndentingWriter p,
                                               String streamName,
                                               Type[] types,
                                               String[] names)
    throws IOException
{
    assert types.length == names.length;

    boolean readObject = false;
    for (int i = 0; i < types.length; i++) {
        if (writeUnmarshalArgument(p, streamName, types[i], names[i])) {
            readObject = true;
        }
        p.pln(";");
    }
    return readObject;
}
 
Example #29
Source File: StubSkeletonWriter.java    From hottub 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 #30
Source File: StubSkeletonWriter.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes 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".
 **/
private static void writeMarshalArguments(IndentingWriter p,
                                          String streamName,
                                          Type[] types, String[] names)
    throws IOException
{
    assert types.length == names.length;

    for (int i = 0; i < types.length; i++) {
        writeMarshalArgument(p, streamName, types[i], names[i]);
        p.pln(";");
    }
}