本文整理汇总了Java中com.apple.internal.jobjc.generator.utils.JavaLang.JLTertiary类的典型用法代码示例。如果您正苦于以下问题:Java JLTertiary类的具体用法?Java JLTertiary怎么用?Java JLTertiary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JLTertiary类属于com.apple.internal.jobjc.generator.utils.JavaLang包,在下文中一共展示了JLTertiary类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFieldCache
import com.apple.internal.jobjc.generator.utils.JavaLang.JLTertiary; //导入依赖的package包/类
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();
}