com.apple.internal.jobjc.generator.utils.JavaLang.JLCtor Java Examples

The following examples show how to use com.apple.internal.jobjc.generator.utils.JavaLang.JLCtor. 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: RootJObjCClass.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override public void writeBeginning(final PrintStream out) {
    out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
    out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));

    JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
    getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
    getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
    getInstR.body.add("return instance;");
    out.print(getInstR);

    JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
    getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
    out.print(getInst);

    JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
    ctor.body.add("this.runtime = runtime;");
    for (final Framework f : frameworks)
        ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
    out.print(ctor);
}
 
Example #2
Source File: RootJObjCClass.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override public void writeBeginning(final PrintStream out) {
    out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
    out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));

    JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
    getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
    getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
    getInstR.body.add("return instance;");
    out.print(getInstR);

    JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
    getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
    out.print(getInst);

    JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
    ctor.body.add("this.runtime = runtime;");
    for (final Framework f : frameworks)
        ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
    out.print(ctor);
}
 
Example #3
Source File: RootJObjCClass.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override public void writeBeginning(final PrintStream out) {
    out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
    out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));

    JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
    getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
    getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
    getInstR.body.add("return instance;");
    out.print(getInstR);

    JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
    getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
    out.print(getInst);

    JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
    ctor.body.add("this.runtime = runtime;");
    for (final Framework f : frameworks)
        ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
    out.print(ctor);
}
 
Example #4
Source File: RootJObjCClass.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override public void writeBeginning(final PrintStream out) {
    out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
    out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));

    JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
    getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
    getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
    getInstR.body.add("return instance;");
    out.print(getInstR);

    JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
    getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
    out.print(getInst);

    JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
    ctor.body.add("this.runtime = runtime;");
    for (final Framework f : frameworks)
        ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
    out.print(ctor);
}
 
Example #5
Source File: RootJObjCClass.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override public void writeBeginning(final PrintStream out) {
    out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
    out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));

    JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
    getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
    getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
    getInstR.body.add("return instance;");
    out.print(getInstR);

    JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
    getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
    out.print(getInst);

    JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
    ctor.body.add("this.runtime = runtime;");
    for (final Framework f : frameworks)
        ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
    out.print(ctor);
}
 
Example #6
Source File: RootJObjCClass.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override public void writeBeginning(final PrintStream out) {
    out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
    out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));

    JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
    getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
    getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
    getInstR.body.add("return instance;");
    out.print(getInstR);

    JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
    getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
    out.print(getInst);

    JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
    ctor.body.add("this.runtime = runtime;");
    for (final Framework f : frameworks)
        ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
    out.print(ctor);
}
 
Example #7
Source File: RootJObjCClass.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override public void writeBeginning(final PrintStream out) {
    out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
    out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));

    JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
    getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
    getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
    getInstR.body.add("return instance;");
    out.print(getInstR);

    JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
    getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
    out.print(getInst);

    JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
    ctor.body.add("this.runtime = runtime;");
    for (final Framework f : frameworks)
        ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
    out.print(ctor);
}
 
Example #8
Source File: RootJObjCClass.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@Override public void writeBeginning(final PrintStream out) {
    out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
    out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));

    JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
    getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
    getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
    getInstR.body.add("return instance;");
    out.print(getInstR);

    JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
    getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
    out.print(getInst);

    JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
    ctor.body.add("this.runtime = runtime;");
    for (final Framework f : frameworks)
        ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
    out.print(ctor);
}
 
Example #9
Source File: RootJObjCClass.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override public void writeBeginning(final PrintStream out) {
    out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
    out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));

    JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
    getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
    getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
    getInstR.body.add("return instance;");
    out.print(getInstR);

    JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
    getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
    out.print(getInst);

    JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
    ctor.body.add("this.runtime = runtime;");
    for (final Framework f : frameworks)
        ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
    out.print(ctor);
}
 
Example #10
Source File: RootJObjCClass.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override public void writeBeginning(final PrintStream out) {
    out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
    out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));

    JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
    getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
    getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
    getInstR.body.add("return instance;");
    out.print(getInstR);

    JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
    getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
    out.print(getInst);

    JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
    ctor.body.add("this.runtime = runtime;");
    for (final Framework f : frameworks)
        ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
    out.print(ctor);
}
 
Example #11
Source File: RootJObjCClass.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override public void writeBeginning(final PrintStream out) {
    out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
    out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));

    JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
    getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
    getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
    getInstR.body.add("return instance;");
    out.print(getInstR);

    JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
    getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
    out.print(getInst);

    JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
    ctor.body.add("this.runtime = runtime;");
    for (final Framework f : frameworks)
        ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
    out.print(ctor);
}
 
Example #12
Source File: RootJObjCClass.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override public void writeBeginning(final PrintStream out) {
    out.print(new JLField("private static", JOBJC_CLASSNAME, "instance"));
    out.print(new JLField("private final", JObjCRuntime.class.getName(), "runtime"));

    JLMethod getInstR = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance", "final JObjCRuntime runtime");
    getInstR.body.add("if(runtime == null) throw new NullPointerException(\"runtime\");");
    getInstR.body.add("if(instance == null) instance = new JObjC(runtime);");
    getInstR.body.add("return instance;");
    out.print(getInstR);

    JLMethod getInst = new JLMethod("public static", JOBJC_CLASSNAME, "getInstance");
    getInst.body.add("return getInstance(JObjCRuntime.getInstance());");
    out.print(getInst);

    JLCtor ctor = new JLCtor("private", JOBJC_CLASSNAME, "final JObjCRuntime runtime");
    ctor.body.add("this.runtime = runtime;");
    for (final Framework f : frameworks)
        ctor.body.add("runtime.registerPackage(\"" + f.pkg + "\");");
    out.print(ctor);
}