Java源码示例:com.apple.internal.jobjc.generator.model.Arg
示例1
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}
示例2
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}
示例3
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}
示例4
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}
示例5
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}
示例6
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}
示例7
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}
示例8
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}
示例9
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}
示例10
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}
示例11
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}
示例12
private static String createFieldCache(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
JLField field = new JLField("private static", type.getCanonicalName(), identifier);
// It's okay to make it static, because the getter isn't static, so the only way to access it is through an instance.
JLMethod getter = new JLMethod("private final", type.getCanonicalName(), "get_" + identifier);
JLCall createIt = new JLCall("new " + type.getCanonicalName());
createIt.args.add(firstArg(fxn));
createIt.args.add("\"" + fxn.name + "\"");
createIt.args.add(fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName());
for (final Arg arg : fxn.args)
createIt.args.add(arg.type.getJType().getCoderDescriptor().getCoderInstanceName());
getter.body.add("return " + new JLTertiary(identifier + " != null", identifier, identifier + " = " + createIt) + ";");
return field.toString() + getter.toString();
}