com.apple.internal.jobjc.generator.Utils.Substituter Java Examples

The following examples show how to use com.apple.internal.jobjc.generator.Utils.Substituter. 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: JavaLang.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static String makeSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private $CLASS $IVAR = null;~" +
        "#public $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #2
Source File: JavaLang.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static String makeStaticSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private static $CLASS $IVAR = null;~" +
        "#public static $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #3
Source File: JavaLang.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static String generateSingleton(final Substituter singleton, final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    singleton.replace("IVAR", instanceVariable);
    singleton.replace("METHOD", methodName);
    singleton.replace("CLASS", className);
    singleton.replace("CTORARGS", Utils.joinWComma(constructorArgs));
    return singleton.toString();
}
 
Example #4
Source File: JavaLang.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static String makeSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private $CLASS $IVAR = null;~" +
        "#public $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #5
Source File: JavaLang.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static String makeStaticSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private static $CLASS $IVAR = null;~" +
        "#public static $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #6
Source File: JavaLang.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static String generateSingleton(final Substituter singleton, final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    singleton.replace("IVAR", instanceVariable);
    singleton.replace("METHOD", methodName);
    singleton.replace("CLASS", className);
    singleton.replace("CTORARGS", Utils.joinWComma(constructorArgs));
    return singleton.toString();
}
 
Example #7
Source File: JavaLang.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static String makeSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private $CLASS $IVAR = null;~" +
        "#public $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #8
Source File: JavaLang.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static String makeStaticSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private static $CLASS $IVAR = null;~" +
        "#public static $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #9
Source File: JavaLang.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static String generateSingleton(final Substituter singleton, final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    singleton.replace("IVAR", instanceVariable);
    singleton.replace("METHOD", methodName);
    singleton.replace("CLASS", className);
    singleton.replace("CTORARGS", Utils.joinWComma(constructorArgs));
    return singleton.toString();
}
 
Example #10
Source File: JavaLang.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static String makeSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private $CLASS $IVAR = null;~" +
        "#public $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #11
Source File: JavaLang.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static String makeStaticSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private static $CLASS $IVAR = null;~" +
        "#public static $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #12
Source File: JavaLang.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static String generateSingleton(final Substituter singleton, final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    singleton.replace("IVAR", instanceVariable);
    singleton.replace("METHOD", methodName);
    singleton.replace("CLASS", className);
    singleton.replace("CTORARGS", Utils.joinWComma(constructorArgs));
    return singleton.toString();
}
 
Example #13
Source File: JavaLang.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static String makeSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private $CLASS $IVAR = null;~" +
        "#public $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #14
Source File: JavaLang.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static String makeStaticSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private static $CLASS $IVAR = null;~" +
        "#public static $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #15
Source File: JavaLang.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static String generateSingleton(final Substituter singleton, final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    singleton.replace("IVAR", instanceVariable);
    singleton.replace("METHOD", methodName);
    singleton.replace("CLASS", className);
    singleton.replace("CTORARGS", Utils.joinWComma(constructorArgs));
    return singleton.toString();
}
 
Example #16
Source File: JavaLang.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static String makeSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private $CLASS $IVAR = null;~" +
        "#public $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #17
Source File: JavaLang.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static String makeStaticSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private static $CLASS $IVAR = null;~" +
        "#public static $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #18
Source File: JavaLang.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static String generateSingleton(final Substituter singleton, final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    singleton.replace("IVAR", instanceVariable);
    singleton.replace("METHOD", methodName);
    singleton.replace("CLASS", className);
    singleton.replace("CTORARGS", Utils.joinWComma(constructorArgs));
    return singleton.toString();
}
 
Example #19
Source File: JavaLang.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static String makeSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private $CLASS $IVAR = null;~" +
        "#public $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #20
Source File: JavaLang.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static String makeStaticSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private static $CLASS $IVAR = null;~" +
        "#public static $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #21
Source File: JavaLang.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static String generateSingleton(final Substituter singleton, final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    singleton.replace("IVAR", instanceVariable);
    singleton.replace("METHOD", methodName);
    singleton.replace("CLASS", className);
    singleton.replace("CTORARGS", Utils.joinWComma(constructorArgs));
    return singleton.toString();
}
 
Example #22
Source File: JavaLang.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static String makeSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private $CLASS $IVAR = null;~" +
        "#public $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #23
Source File: JavaLang.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static String makeStaticSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private static $CLASS $IVAR = null;~" +
        "#public static $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #24
Source File: JavaLang.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static String generateSingleton(final Substituter singleton, final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    singleton.replace("IVAR", instanceVariable);
    singleton.replace("METHOD", methodName);
    singleton.replace("CLASS", className);
    singleton.replace("CTORARGS", Utils.joinWComma(constructorArgs));
    return singleton.toString();
}
 
Example #25
Source File: JavaLang.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static String makeSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private $CLASS $IVAR = null;~" +
        "#public $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #26
Source File: JavaLang.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static String makeStaticSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private static $CLASS $IVAR = null;~" +
        "#public static $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #27
Source File: JavaLang.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static String generateSingleton(final Substituter singleton, final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    singleton.replace("IVAR", instanceVariable);
    singleton.replace("METHOD", methodName);
    singleton.replace("CLASS", className);
    singleton.replace("CTORARGS", Utils.joinWComma(constructorArgs));
    return singleton.toString();
}
 
Example #28
Source File: JavaLang.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static String makeSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private $CLASS $IVAR = null;~" +
        "#public $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #29
Source File: JavaLang.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static String makeStaticSingleton(final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    return generateSingleton(new Substituter(
        "#private static $CLASS $IVAR = null;~" +
        "#public static $CLASS $METHOD() {~" +
        "##return $IVAR != null ? $IVAR : ($IVAR = new $CLASS($CTORARGS));~" +
        "#}~"),
    instanceVariable, methodName, className, constructorArgs);
}
 
Example #30
Source File: JavaLang.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static String generateSingleton(final Substituter singleton, final String instanceVariable, final String methodName, final String className, final String...constructorArgs) {
    singleton.replace("IVAR", instanceVariable);
    singleton.replace("METHOD", methodName);
    singleton.replace("CLASS", className);
    singleton.replace("CTORARGS", Utils.joinWComma(constructorArgs));
    return singleton.toString();
}