com.apple.internal.jobjc.generator.model.coders.CoderDescriptor Java Examples

The following examples show how to use com.apple.internal.jobjc.generator.model.coders.CoderDescriptor. 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: StructClassFile.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void writeField(final Struct.Field field, final PrintStream out){
    if(field.type.type32 instanceof NBitfield){
        out.format("\t// Skipping bitfield '%1$s'\n", field.name);
        return;
    }
    String privName = field.name + "__";
    String offsetName = field.name.toUpperCase() + "_OFFSET";
    JType jtype = field.type.getJType();
    String retType = jtype.getJavaReturnTypeName();
    CoderDescriptor cdesc = jtype.getCoderDescriptor();
    out.println();
    out.println("\tprivate static final int " + offsetName + " = " + JObjCRuntime.class.getName()
            + ".IS64 ? " + field.field64.offset64() + " : " + field.field32.offset32() + ";");

    out.println("\t//" + cdesc.getClass().toString());
    out.println("\tpublic " + retType + " " + getterName(field) + "(){");
    out.println(jtype.createPopAddr("getRuntime()", "this.raw.bufferPtr + " + offsetName));
    out.println(jtype.createReturn());
    out.println("\t}");
    out.println();
    out.println("\tpublic void " + setterName(field.name) + "(final " + retType + " " + privName + "){");
    out.println("\t\t" + cdesc.getPushAddrStatementFor("getRuntime()", "this.raw.bufferPtr + " + offsetName, privName));
    out.println("\t}");
}
 
Example #2
Source File: StructClassFile.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
private void writeField(final Struct.Field field, final PrintStream out){
    if(field.type.type32 instanceof NBitfield){
        out.format("\t// Skipping bitfield '%1$s'\n", field.name);
        return;
    }
    String privName = field.name + "__";
    String offsetName = field.name.toUpperCase() + "_OFFSET";
    JType jtype = field.type.getJType();
    String retType = jtype.getJavaReturnTypeName();
    CoderDescriptor cdesc = jtype.getCoderDescriptor();
    out.println();
    out.println("\tprivate static final int " + offsetName + " = " + JObjCRuntime.class.getName()
            + ".IS64 ? " + field.field64.offset64() + " : " + field.field32.offset32() + ";");

    out.println("\t//" + cdesc.getClass().toString());
    out.println("\tpublic " + retType + " " + getterName(field) + "(){");
    out.println(jtype.createPopAddr("getRuntime()", "this.raw.bufferPtr + " + offsetName));
    out.println(jtype.createReturn());
    out.println("\t}");
    out.println();
    out.println("\tpublic void " + setterName(field.name) + "(final " + retType + " " + privName + "){");
    out.println("\t\t" + cdesc.getPushAddrStatementFor("getRuntime()", "this.raw.bufferPtr + " + offsetName, privName));
    out.println("\t}");
}
 
Example #3
Source File: StructClassFile.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void writeField(final Struct.Field field, final PrintStream out){
    if(field.type.type32 instanceof NBitfield){
        out.format("\t// Skipping bitfield '%1$s'\n", field.name);
        return;
    }
    String privName = field.name + "__";
    String offsetName = field.name.toUpperCase() + "_OFFSET";
    JType jtype = field.type.getJType();
    String retType = jtype.getJavaReturnTypeName();
    CoderDescriptor cdesc = jtype.getCoderDescriptor();
    out.println();
    out.println("\tprivate static final int " + offsetName + " = " + JObjCRuntime.class.getName()
            + ".IS64 ? " + field.field64.offset64() + " : " + field.field32.offset32() + ";");

    out.println("\t//" + cdesc.getClass().toString());
    out.println("\tpublic " + retType + " " + getterName(field) + "(){");
    out.println(jtype.createPopAddr("getRuntime()", "this.raw.bufferPtr + " + offsetName));
    out.println(jtype.createReturn());
    out.println("\t}");
    out.println();
    out.println("\tpublic void " + setterName(field.name) + "(final " + retType + " " + privName + "){");
    out.println("\t\t" + cdesc.getPushAddrStatementFor("getRuntime()", "this.raw.bufferPtr + " + offsetName, privName));
    out.println("\t}");
}
 
Example #4
Source File: StructClassFile.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void writeField(final Struct.Field field, final PrintStream out){
    if(field.type.type32 instanceof NBitfield){
        out.format("\t// Skipping bitfield '%1$s'\n", field.name);
        return;
    }
    String privName = field.name + "__";
    String offsetName = field.name.toUpperCase() + "_OFFSET";
    JType jtype = field.type.getJType();
    String retType = jtype.getJavaReturnTypeName();
    CoderDescriptor cdesc = jtype.getCoderDescriptor();
    out.println();
    out.println("\tprivate static final int " + offsetName + " = " + JObjCRuntime.class.getName()
            + ".IS64 ? " + field.field64.offset64() + " : " + field.field32.offset32() + ";");

    out.println("\t//" + cdesc.getClass().toString());
    out.println("\tpublic " + retType + " " + getterName(field) + "(){");
    out.println(jtype.createPopAddr("getRuntime()", "this.raw.bufferPtr + " + offsetName));
    out.println(jtype.createReturn());
    out.println("\t}");
    out.println();
    out.println("\tpublic void " + setterName(field.name) + "(final " + retType + " " + privName + "){");
    out.println("\t\t" + cdesc.getPushAddrStatementFor("getRuntime()", "this.raw.bufferPtr + " + offsetName, privName));
    out.println("\t}");
}
 
Example #5
Source File: StructClassFile.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private void writeField(final Struct.Field field, final PrintStream out){
    if(field.type.type32 instanceof NBitfield){
        out.format("\t// Skipping bitfield '%1$s'\n", field.name);
        return;
    }
    String privName = field.name + "__";
    String offsetName = field.name.toUpperCase() + "_OFFSET";
    JType jtype = field.type.getJType();
    String retType = jtype.getJavaReturnTypeName();
    CoderDescriptor cdesc = jtype.getCoderDescriptor();
    out.println();
    out.println("\tprivate static final int " + offsetName + " = " + JObjCRuntime.class.getName()
            + ".IS64 ? " + field.field64.offset64() + " : " + field.field32.offset32() + ";");

    out.println("\t//" + cdesc.getClass().toString());
    out.println("\tpublic " + retType + " " + getterName(field) + "(){");
    out.println(jtype.createPopAddr("getRuntime()", "this.raw.bufferPtr + " + offsetName));
    out.println(jtype.createReturn());
    out.println("\t}");
    out.println();
    out.println("\tpublic void " + setterName(field.name) + "(final " + retType + " " + privName + "){");
    out.println("\t\t" + cdesc.getPushAddrStatementFor("getRuntime()", "this.raw.bufferPtr + " + offsetName, privName));
    out.println("\t}");
}
 
Example #6
Source File: StructClassFile.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void writeField(final Struct.Field field, final PrintStream out){
    if(field.type.type32 instanceof NBitfield){
        out.format("\t// Skipping bitfield '%1$s'\n", field.name);
        return;
    }
    String privName = field.name + "__";
    String offsetName = field.name.toUpperCase() + "_OFFSET";
    JType jtype = field.type.getJType();
    String retType = jtype.getJavaReturnTypeName();
    CoderDescriptor cdesc = jtype.getCoderDescriptor();
    out.println();
    out.println("\tprivate static final int " + offsetName + " = " + JObjCRuntime.class.getName()
            + ".IS64 ? " + field.field64.offset64() + " : " + field.field32.offset32() + ";");

    out.println("\t//" + cdesc.getClass().toString());
    out.println("\tpublic " + retType + " " + getterName(field) + "(){");
    out.println(jtype.createPopAddr("getRuntime()", "this.raw.bufferPtr + " + offsetName));
    out.println(jtype.createReturn());
    out.println("\t}");
    out.println();
    out.println("\tpublic void " + setterName(field.name) + "(final " + retType + " " + privName + "){");
    out.println("\t\t" + cdesc.getPushAddrStatementFor("getRuntime()", "this.raw.bufferPtr + " + offsetName, privName));
    out.println("\t}");
}
 
Example #7
Source File: JType.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public JPrimitive(final Type type, final ComplexCoderDescriptor coderDesc) {
    this.type = type;
    this.coderDescriptor = coderDesc;

    this.parameterizable = new JType() {
        @Override public String getJavaTypeName() { return coderDescriptor.getJavaObjectClass(); }
        @Override public CoderDescriptor getCoderDescriptor() { throw new RuntimeException(); }
    };
}
 
Example #8
Source File: JType.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public JPrimitive(final Type type, final ComplexCoderDescriptor coderDesc) {
    this.type = type;
    this.coderDescriptor = coderDesc;

    this.parameterizable = new JType() {
        @Override public String getJavaTypeName() { return coderDescriptor.getJavaObjectClass(); }
        @Override public CoderDescriptor getCoderDescriptor() { throw new RuntimeException(); }
    };
}
 
Example #9
Source File: JType.java    From jdk8u-jdk with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return NSClassCoderDescriptor.INST; } 
Example #10
Source File: JType.java    From openjdk-8-source with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return coderDescriptor; } 
Example #11
Source File: JType.java    From hottub with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return NSClassCoderDescriptor.INST; } 
Example #12
Source File: JType.java    From jdk8u-jdk with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return PointerCoderDescriptor.INST; } 
Example #13
Source File: JType.java    From jdk8u-jdk with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return SELCoderDescriptor.INST; } 
Example #14
Source File: JType.java    From jdk8u-jdk with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor(){ return CoderDescriptor.VOID_DESC; } 
Example #15
Source File: JType.java    From jdk8u-jdk with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return UnknownCoderDescriptor.UNKNOWN_DESC; } 
Example #16
Source File: JType.java    From jdk8u-jdk with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return PointerCoderDescriptor.INST; } 
Example #17
Source File: JType.java    From hottub with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return SELCoderDescriptor.INST; } 
Example #18
Source File: JType.java    From openjdk-8-source with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return NSClassCoderDescriptor.INST; } 
Example #19
Source File: JType.java    From openjdk-jdk8u with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor(){ return CoderDescriptor.VOID_DESC; } 
Example #20
Source File: JType.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return UnknownCoderDescriptor.UNKNOWN_DESC; } 
Example #21
Source File: JType.java    From openjdk-8 with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return IDCoderDescriptor.INST; } 
Example #22
Source File: JType.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 votes vote down vote up
public abstract CoderDescriptor getCoderDescriptor(); 
Example #23
Source File: JType.java    From jdk8u_jdk with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return coderDescriptor; } 
Example #24
Source File: JType.java    From jdk8u_jdk with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return IDCoderDescriptor.INST; } 
Example #25
Source File: JType.java    From jdk8u_jdk with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor(){ return CoderDescriptor.VOID_DESC; } 
Example #26
Source File: JType.java    From openjdk-jdk8u with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return NSClassCoderDescriptor.INST; } 
Example #27
Source File: JType.java    From openjdk-jdk8u with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return IDCoderDescriptor.INST; } 
Example #28
Source File: JType.java    From openjdk-jdk8u with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return SELCoderDescriptor.INST; } 
Example #29
Source File: JType.java    From jdk8u-dev-jdk with GNU General Public License v2.0 votes vote down vote up
public abstract CoderDescriptor getCoderDescriptor(); 
Example #30
Source File: JType.java    From jdk8u_jdk with GNU General Public License v2.0 votes vote down vote up
@Override public CoderDescriptor getCoderDescriptor() { return PointerCoderDescriptor.INST; }