Java源码示例:com.apple.internal.jobjc.generator.utils.Fp.Map1

示例1
protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Framework fw : fws){
        for(final Width width : Width.values()){
            System.out.println("SOR -- Getting Struct offsets @" + width + " for " + fw.name);
            String nativeSrc = generateFileForFramework(fw, width);
            String executable = compileObjC(nativeSrc, width);
            execute(executable, new Map1<String,Object>(){
                public Object apply(String ln) {
                    try {
                        processLine(ln, fws, width);
                        return null;
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
}
 
示例2
@Override protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Width arch : Width.values()){
        System.out.println("SORBB -- Getting Struct offsets @" + arch.toString());
        String nativeSrc = generateFileForFrameworks(fws, arch);
        String executable = compileObjC(nativeSrc, arch);
        execute(executable, new Map1<String,Object>(){
            public Object apply(String ln) {
                try {
                    processLine(ln, fws, arch);
                    return null;
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}
 
示例3
@Override public void writeBeginning(final PrintStream out) {
    out.println();
    out.println("\tpublic static int SIZEOF = " + JObjCRuntime.class.getName() + ".IS64 ? "
            + ((NStruct) struct.type.type64).sizeof64() + " : " + ((NStruct) struct.type.type32).sizeof32() + ";");
    out.println();
    out.format("\tpublic final static %1$s getStructCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\[email protected] public final %1$s getCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\tprivate final static %1$s coder = new %1$s(SIZEOF%2$s%3$s){\n", StructCoder.class.getCanonicalName(),
            (struct.fields.size() > 0 ? ",\n\t\t" : ""),
            Fp.join(",\n\t\t", Fp.map(new Map1<Field,String>(){
                public String apply(Field a) {
                    return a.type.getJType().getCoderDescriptor().getCoderInstanceName();
                }}, struct.fields)));
    out.format("\t\[email protected] protected %1$s newInstance(%2$s runtime){ return new %1$s(runtime); }\n",
            struct.name,
            JObjCRuntime.class.getCanonicalName());
    out.println("\t};");
    out.println();
    out.println("\t" + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime){");
    out.println("\t\tsuper(runtime, SIZEOF);");
    out.println("\t}");
    out.println();
    out.println("\tpublic " + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime, final com.apple.jobjc.NativeBuffer buffer) {");
    out.println("\t\tsuper(runtime, buffer, SIZEOF);");
    out.println("\t}");
}
 
示例4
protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Framework fw : fws){
        for(final Width width : Width.values()){
            System.out.println("SOR -- Getting Struct offsets @" + width + " for " + fw.name);
            String nativeSrc = generateFileForFramework(fw, width);
            String executable = compileObjC(nativeSrc, width);
            execute(executable, new Map1<String,Object>(){
                public Object apply(String ln) {
                    try {
                        processLine(ln, fws, width);
                        return null;
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
}
 
示例5
@Override protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Width arch : Width.values()){
        System.out.println("SORBB -- Getting Struct offsets @" + arch.toString());
        String nativeSrc = generateFileForFrameworks(fws, arch);
        String executable = compileObjC(nativeSrc, arch);
        execute(executable, new Map1<String,Object>(){
            public Object apply(String ln) {
                try {
                    processLine(ln, fws, arch);
                    return null;
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}
 
示例6
@Override public void writeBeginning(final PrintStream out) {
    out.println();
    out.println("\tpublic static int SIZEOF = " + JObjCRuntime.class.getName() + ".IS64 ? "
            + ((NStruct) struct.type.type64).sizeof64() + " : " + ((NStruct) struct.type.type32).sizeof32() + ";");
    out.println();
    out.format("\tpublic final static %1$s getStructCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\[email protected] public final %1$s getCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\tprivate final static %1$s coder = new %1$s(SIZEOF%2$s%3$s){\n", StructCoder.class.getCanonicalName(),
            (struct.fields.size() > 0 ? ",\n\t\t" : ""),
            Fp.join(",\n\t\t", Fp.map(new Map1<Field,String>(){
                public String apply(Field a) {
                    return a.type.getJType().getCoderDescriptor().getCoderInstanceName();
                }}, struct.fields)));
    out.format("\t\[email protected] protected %1$s newInstance(%2$s runtime){ return new %1$s(runtime); }\n",
            struct.name,
            JObjCRuntime.class.getCanonicalName());
    out.println("\t};");
    out.println();
    out.println("\t" + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime){");
    out.println("\t\tsuper(runtime, SIZEOF);");
    out.println("\t}");
    out.println();
    out.println("\tpublic " + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime, final com.apple.jobjc.NativeBuffer buffer) {");
    out.println("\t\tsuper(runtime, buffer, SIZEOF);");
    out.println("\t}");
}
 
示例7
protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Framework fw : fws){
        for(final Width width : Width.values()){
            System.out.println("SOR -- Getting Struct offsets @" + width + " for " + fw.name);
            String nativeSrc = generateFileForFramework(fw, width);
            String executable = compileObjC(nativeSrc, width);
            execute(executable, new Map1<String,Object>(){
                public Object apply(String ln) {
                    try {
                        processLine(ln, fws, width);
                        return null;
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
}
 
示例8
@Override protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Width arch : Width.values()){
        System.out.println("SORBB -- Getting Struct offsets @" + arch.toString());
        String nativeSrc = generateFileForFrameworks(fws, arch);
        String executable = compileObjC(nativeSrc, arch);
        execute(executable, new Map1<String,Object>(){
            public Object apply(String ln) {
                try {
                    processLine(ln, fws, arch);
                    return null;
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}
 
示例9
@Override public void writeBeginning(final PrintStream out) {
    out.println();
    out.println("\tpublic static int SIZEOF = " + JObjCRuntime.class.getName() + ".IS64 ? "
            + ((NStruct) struct.type.type64).sizeof64() + " : " + ((NStruct) struct.type.type32).sizeof32() + ";");
    out.println();
    out.format("\tpublic final static %1$s getStructCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\[email protected] public final %1$s getCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\tprivate final static %1$s coder = new %1$s(SIZEOF%2$s%3$s){\n", StructCoder.class.getCanonicalName(),
            (struct.fields.size() > 0 ? ",\n\t\t" : ""),
            Fp.join(",\n\t\t", Fp.map(new Map1<Field,String>(){
                public String apply(Field a) {
                    return a.type.getJType().getCoderDescriptor().getCoderInstanceName();
                }}, struct.fields)));
    out.format("\t\[email protected] protected %1$s newInstance(%2$s runtime){ return new %1$s(runtime); }\n",
            struct.name,
            JObjCRuntime.class.getCanonicalName());
    out.println("\t};");
    out.println();
    out.println("\t" + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime){");
    out.println("\t\tsuper(runtime, SIZEOF);");
    out.println("\t}");
    out.println();
    out.println("\tpublic " + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime, final com.apple.jobjc.NativeBuffer buffer) {");
    out.println("\t\tsuper(runtime, buffer, SIZEOF);");
    out.println("\t}");
}
 
示例10
protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Framework fw : fws){
        for(final Width width : Width.values()){
            System.out.println("SOR -- Getting Struct offsets @" + width + " for " + fw.name);
            String nativeSrc = generateFileForFramework(fw, width);
            String executable = compileObjC(nativeSrc, width);
            execute(executable, new Map1<String,Object>(){
                public Object apply(String ln) {
                    try {
                        processLine(ln, fws, width);
                        return null;
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
}
 
示例11
@Override protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Width arch : Width.values()){
        System.out.println("SORBB -- Getting Struct offsets @" + arch.toString());
        String nativeSrc = generateFileForFrameworks(fws, arch);
        String executable = compileObjC(nativeSrc, arch);
        execute(executable, new Map1<String,Object>(){
            public Object apply(String ln) {
                try {
                    processLine(ln, fws, arch);
                    return null;
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}
 
示例12
@Override public void writeBeginning(final PrintStream out) {
    out.println();
    out.println("\tpublic static int SIZEOF = " + JObjCRuntime.class.getName() + ".IS64 ? "
            + ((NStruct) struct.type.type64).sizeof64() + " : " + ((NStruct) struct.type.type32).sizeof32() + ";");
    out.println();
    out.format("\tpublic final static %1$s getStructCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\[email protected] public final %1$s getCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\tprivate final static %1$s coder = new %1$s(SIZEOF%2$s%3$s){\n", StructCoder.class.getCanonicalName(),
            (struct.fields.size() > 0 ? ",\n\t\t" : ""),
            Fp.join(",\n\t\t", Fp.map(new Map1<Field,String>(){
                public String apply(Field a) {
                    return a.type.getJType().getCoderDescriptor().getCoderInstanceName();
                }}, struct.fields)));
    out.format("\t\[email protected] protected %1$s newInstance(%2$s runtime){ return new %1$s(runtime); }\n",
            struct.name,
            JObjCRuntime.class.getCanonicalName());
    out.println("\t};");
    out.println();
    out.println("\t" + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime){");
    out.println("\t\tsuper(runtime, SIZEOF);");
    out.println("\t}");
    out.println();
    out.println("\tpublic " + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime, final com.apple.jobjc.NativeBuffer buffer) {");
    out.println("\t\tsuper(runtime, buffer, SIZEOF);");
    out.println("\t}");
}
 
示例13
protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Framework fw : fws){
        for(final Width width : Width.values()){
            System.out.println("SOR -- Getting Struct offsets @" + width + " for " + fw.name);
            String nativeSrc = generateFileForFramework(fw, width);
            String executable = compileObjC(nativeSrc, width);
            execute(executable, new Map1<String,Object>(){
                public Object apply(String ln) {
                    try {
                        processLine(ln, fws, width);
                        return null;
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
}
 
示例14
@Override protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Width arch : Width.values()){
        System.out.println("SORBB -- Getting Struct offsets @" + arch.toString());
        String nativeSrc = generateFileForFrameworks(fws, arch);
        String executable = compileObjC(nativeSrc, arch);
        execute(executable, new Map1<String,Object>(){
            public Object apply(String ln) {
                try {
                    processLine(ln, fws, arch);
                    return null;
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}
 
示例15
@Override public void writeBeginning(final PrintStream out) {
    out.println();
    out.println("\tpublic static int SIZEOF = " + JObjCRuntime.class.getName() + ".IS64 ? "
            + ((NStruct) struct.type.type64).sizeof64() + " : " + ((NStruct) struct.type.type32).sizeof32() + ";");
    out.println();
    out.format("\tpublic final static %1$s getStructCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\[email protected] public final %1$s getCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\tprivate final static %1$s coder = new %1$s(SIZEOF%2$s%3$s){\n", StructCoder.class.getCanonicalName(),
            (struct.fields.size() > 0 ? ",\n\t\t" : ""),
            Fp.join(",\n\t\t", Fp.map(new Map1<Field,String>(){
                public String apply(Field a) {
                    return a.type.getJType().getCoderDescriptor().getCoderInstanceName();
                }}, struct.fields)));
    out.format("\t\[email protected] protected %1$s newInstance(%2$s runtime){ return new %1$s(runtime); }\n",
            struct.name,
            JObjCRuntime.class.getCanonicalName());
    out.println("\t};");
    out.println();
    out.println("\t" + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime){");
    out.println("\t\tsuper(runtime, SIZEOF);");
    out.println("\t}");
    out.println();
    out.println("\tpublic " + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime, final com.apple.jobjc.NativeBuffer buffer) {");
    out.println("\t\tsuper(runtime, buffer, SIZEOF);");
    out.println("\t}");
}
 
示例16
protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Framework fw : fws){
        for(final Width width : Width.values()){
            System.out.println("SOR -- Getting Struct offsets @" + width + " for " + fw.name);
            String nativeSrc = generateFileForFramework(fw, width);
            String executable = compileObjC(nativeSrc, width);
            execute(executable, new Map1<String,Object>(){
                public Object apply(String ln) {
                    try {
                        processLine(ln, fws, width);
                        return null;
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
}
 
示例17
@Override protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Width arch : Width.values()){
        System.out.println("SORBB -- Getting Struct offsets @" + arch.toString());
        String nativeSrc = generateFileForFrameworks(fws, arch);
        String executable = compileObjC(nativeSrc, arch);
        execute(executable, new Map1<String,Object>(){
            public Object apply(String ln) {
                try {
                    processLine(ln, fws, arch);
                    return null;
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}
 
示例18
@Override public void writeBeginning(final PrintStream out) {
    out.println();
    out.println("\tpublic static int SIZEOF = " + JObjCRuntime.class.getName() + ".IS64 ? "
            + ((NStruct) struct.type.type64).sizeof64() + " : " + ((NStruct) struct.type.type32).sizeof32() + ";");
    out.println();
    out.format("\tpublic final static %1$s getStructCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\[email protected] public final %1$s getCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\tprivate final static %1$s coder = new %1$s(SIZEOF%2$s%3$s){\n", StructCoder.class.getCanonicalName(),
            (struct.fields.size() > 0 ? ",\n\t\t" : ""),
            Fp.join(",\n\t\t", Fp.map(new Map1<Field,String>(){
                public String apply(Field a) {
                    return a.type.getJType().getCoderDescriptor().getCoderInstanceName();
                }}, struct.fields)));
    out.format("\t\[email protected] protected %1$s newInstance(%2$s runtime){ return new %1$s(runtime); }\n",
            struct.name,
            JObjCRuntime.class.getCanonicalName());
    out.println("\t};");
    out.println();
    out.println("\t" + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime){");
    out.println("\t\tsuper(runtime, SIZEOF);");
    out.println("\t}");
    out.println();
    out.println("\tpublic " + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime, final com.apple.jobjc.NativeBuffer buffer) {");
    out.println("\t\tsuper(runtime, buffer, SIZEOF);");
    out.println("\t}");
}
 
示例19
protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Framework fw : fws){
        for(final Width width : Width.values()){
            System.out.println("SOR -- Getting Struct offsets @" + width + " for " + fw.name);
            String nativeSrc = generateFileForFramework(fw, width);
            String executable = compileObjC(nativeSrc, width);
            execute(executable, new Map1<String,Object>(){
                public Object apply(String ln) {
                    try {
                        processLine(ln, fws, width);
                        return null;
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
}
 
示例20
@Override protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Width arch : Width.values()){
        System.out.println("SORBB -- Getting Struct offsets @" + arch.toString());
        String nativeSrc = generateFileForFrameworks(fws, arch);
        String executable = compileObjC(nativeSrc, arch);
        execute(executable, new Map1<String,Object>(){
            public Object apply(String ln) {
                try {
                    processLine(ln, fws, arch);
                    return null;
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}
 
示例21
@Override public void writeBeginning(final PrintStream out) {
    out.println();
    out.println("\tpublic static int SIZEOF = " + JObjCRuntime.class.getName() + ".IS64 ? "
            + ((NStruct) struct.type.type64).sizeof64() + " : " + ((NStruct) struct.type.type32).sizeof32() + ";");
    out.println();
    out.format("\tpublic final static %1$s getStructCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\[email protected] public final %1$s getCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\tprivate final static %1$s coder = new %1$s(SIZEOF%2$s%3$s){\n", StructCoder.class.getCanonicalName(),
            (struct.fields.size() > 0 ? ",\n\t\t" : ""),
            Fp.join(",\n\t\t", Fp.map(new Map1<Field,String>(){
                public String apply(Field a) {
                    return a.type.getJType().getCoderDescriptor().getCoderInstanceName();
                }}, struct.fields)));
    out.format("\t\[email protected] protected %1$s newInstance(%2$s runtime){ return new %1$s(runtime); }\n",
            struct.name,
            JObjCRuntime.class.getCanonicalName());
    out.println("\t};");
    out.println();
    out.println("\t" + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime){");
    out.println("\t\tsuper(runtime, SIZEOF);");
    out.println("\t}");
    out.println();
    out.println("\tpublic " + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime, final com.apple.jobjc.NativeBuffer buffer) {");
    out.println("\t\tsuper(runtime, buffer, SIZEOF);");
    out.println("\t}");
}
 
示例22
protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Framework fw : fws){
        for(final Width width : Width.values()){
            System.out.println("SOR -- Getting Struct offsets @" + width + " for " + fw.name);
            String nativeSrc = generateFileForFramework(fw, width);
            String executable = compileObjC(nativeSrc, width);
            execute(executable, new Map1<String,Object>(){
                public Object apply(String ln) {
                    try {
                        processLine(ln, fws, width);
                        return null;
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
}
 
示例23
@Override protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Width arch : Width.values()){
        System.out.println("SORBB -- Getting Struct offsets @" + arch.toString());
        String nativeSrc = generateFileForFrameworks(fws, arch);
        String executable = compileObjC(nativeSrc, arch);
        execute(executable, new Map1<String,Object>(){
            public Object apply(String ln) {
                try {
                    processLine(ln, fws, arch);
                    return null;
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}
 
示例24
@Override public void writeBeginning(final PrintStream out) {
    out.println();
    out.println("\tpublic static int SIZEOF = " + JObjCRuntime.class.getName() + ".IS64 ? "
            + ((NStruct) struct.type.type64).sizeof64() + " : " + ((NStruct) struct.type.type32).sizeof32() + ";");
    out.println();
    out.format("\tpublic final static %1$s getStructCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\[email protected] public final %1$s getCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\tprivate final static %1$s coder = new %1$s(SIZEOF%2$s%3$s){\n", StructCoder.class.getCanonicalName(),
            (struct.fields.size() > 0 ? ",\n\t\t" : ""),
            Fp.join(",\n\t\t", Fp.map(new Map1<Field,String>(){
                public String apply(Field a) {
                    return a.type.getJType().getCoderDescriptor().getCoderInstanceName();
                }}, struct.fields)));
    out.format("\t\[email protected] protected %1$s newInstance(%2$s runtime){ return new %1$s(runtime); }\n",
            struct.name,
            JObjCRuntime.class.getCanonicalName());
    out.println("\t};");
    out.println();
    out.println("\t" + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime){");
    out.println("\t\tsuper(runtime, SIZEOF);");
    out.println("\t}");
    out.println();
    out.println("\tpublic " + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime, final com.apple.jobjc.NativeBuffer buffer) {");
    out.println("\t\tsuper(runtime, buffer, SIZEOF);");
    out.println("\t}");
}
 
示例25
protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Framework fw : fws){
        for(final Width width : Width.values()){
            System.out.println("SOR -- Getting Struct offsets @" + width + " for " + fw.name);
            String nativeSrc = generateFileForFramework(fw, width);
            String executable = compileObjC(nativeSrc, width);
            execute(executable, new Map1<String,Object>(){
                public Object apply(String ln) {
                    try {
                        processLine(ln, fws, width);
                        return null;
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
}
 
示例26
@Override protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Width arch : Width.values()){
        System.out.println("SORBB -- Getting Struct offsets @" + arch.toString());
        String nativeSrc = generateFileForFrameworks(fws, arch);
        String executable = compileObjC(nativeSrc, arch);
        execute(executable, new Map1<String,Object>(){
            public Object apply(String ln) {
                try {
                    processLine(ln, fws, arch);
                    return null;
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}
 
示例27
@Override public void writeBeginning(final PrintStream out) {
    out.println();
    out.println("\tpublic static int SIZEOF = " + JObjCRuntime.class.getName() + ".IS64 ? "
            + ((NStruct) struct.type.type64).sizeof64() + " : " + ((NStruct) struct.type.type32).sizeof32() + ";");
    out.println();
    out.format("\tpublic final static %1$s getStructCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\[email protected] public final %1$s getCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\tprivate final static %1$s coder = new %1$s(SIZEOF%2$s%3$s){\n", StructCoder.class.getCanonicalName(),
            (struct.fields.size() > 0 ? ",\n\t\t" : ""),
            Fp.join(",\n\t\t", Fp.map(new Map1<Field,String>(){
                public String apply(Field a) {
                    return a.type.getJType().getCoderDescriptor().getCoderInstanceName();
                }}, struct.fields)));
    out.format("\t\[email protected] protected %1$s newInstance(%2$s runtime){ return new %1$s(runtime); }\n",
            struct.name,
            JObjCRuntime.class.getCanonicalName());
    out.println("\t};");
    out.println();
    out.println("\t" + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime){");
    out.println("\t\tsuper(runtime, SIZEOF);");
    out.println("\t}");
    out.println();
    out.println("\tpublic " + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime, final com.apple.jobjc.NativeBuffer buffer) {");
    out.println("\t\tsuper(runtime, buffer, SIZEOF);");
    out.println("\t}");
}
 
示例28
protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Framework fw : fws){
        for(final Width width : Width.values()){
            System.out.println("SOR -- Getting Struct offsets @" + width + " for " + fw.name);
            String nativeSrc = generateFileForFramework(fw, width);
            String executable = compileObjC(nativeSrc, width);
            execute(executable, new Map1<String,Object>(){
                public Object apply(String ln) {
                    try {
                        processLine(ln, fws, width);
                        return null;
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
            });
        }
    }
}
 
示例29
@Override protected void _resolve(final Collection<Framework> fws) throws Exception{
    for(final Width arch : Width.values()){
        System.out.println("SORBB -- Getting Struct offsets @" + arch.toString());
        String nativeSrc = generateFileForFrameworks(fws, arch);
        String executable = compileObjC(nativeSrc, arch);
        execute(executable, new Map1<String,Object>(){
            public Object apply(String ln) {
                try {
                    processLine(ln, fws, arch);
                    return null;
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }
}
 
示例30
@Override public void writeBeginning(final PrintStream out) {
    out.println();
    out.println("\tpublic static int SIZEOF = " + JObjCRuntime.class.getName() + ".IS64 ? "
            + ((NStruct) struct.type.type64).sizeof64() + " : " + ((NStruct) struct.type.type32).sizeof32() + ";");
    out.println();
    out.format("\tpublic final static %1$s getStructCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\[email protected] public final %1$s getCoder(){ return coder; }\n", StructCoder.class.getCanonicalName());
    out.format("\tprivate final static %1$s coder = new %1$s(SIZEOF%2$s%3$s){\n", StructCoder.class.getCanonicalName(),
            (struct.fields.size() > 0 ? ",\n\t\t" : ""),
            Fp.join(",\n\t\t", Fp.map(new Map1<Field,String>(){
                public String apply(Field a) {
                    return a.type.getJType().getCoderDescriptor().getCoderInstanceName();
                }}, struct.fields)));
    out.format("\t\[email protected] protected %1$s newInstance(%2$s runtime){ return new %1$s(runtime); }\n",
            struct.name,
            JObjCRuntime.class.getCanonicalName());
    out.println("\t};");
    out.println();
    out.println("\t" + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime){");
    out.println("\t\tsuper(runtime, SIZEOF);");
    out.println("\t}");
    out.println();
    out.println("\tpublic " + struct.name + "(final " + JObjCRuntime.class.getCanonicalName() + " runtime, final com.apple.jobjc.NativeBuffer buffer) {");
    out.println("\t\tsuper(runtime, buffer, SIZEOF);");
    out.println("\t}");
}