Java源码示例:com.apple.jobjc.Coder
示例1
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
示例2
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
示例3
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
示例4
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
示例5
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
示例6
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
示例7
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
示例8
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
示例9
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
示例10
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
示例11
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
示例12
private static String createLocalNew(final Class<? extends Invoke> type, final Function fxn) {
final String identifier = makeInstanceName(fxn);
StringWriter out = new StringWriter();
out.append(String.format("%3$s[] argCoders = new %3$s[%1$d + %2$s.length];\n", fxn.args.size(), VARARGS_NAME, Coder.class.getCanonicalName()));
for(int i = 0; i < fxn.args.size(); i++)
out.append(String.format("argCoders[%1$d] = %2$s;\n", i, fxn.args.get(0).type.getJType().getCoderDescriptor().getCoderInstanceName()));
if(fxn.variadic){
out.append(String.format("for(int i = %1$d; i < (%1$d + %2$s.length); i++)\n", fxn.args.size(), VARARGS_NAME));
out.append(String.format("\targCoders[i] = %1$s.getCoderAtRuntime(%2$s[i - %3$s]);\n", Coder.class.getCanonicalName(), VARARGS_NAME, fxn.args.size()));
}
out.append("final " + type.getCanonicalName() + " " + identifier + " = new " + type.getCanonicalName() + "(" + firstArg(fxn) + ", \"" + fxn.name + "\", "
+ fxn.returnValue.type.getJType().getCoderDescriptor().getCoderInstanceName() + ", argCoders);");
return out.toString();
}
示例13
public CoderDescriptor(final Coder coder, final String pushName, final String popName) {
this.coder = coder;
this.coderInstanceName = coder.getClass().getCanonicalName() + ".INST";
if (coderInstanceName == null) throw new NullPointerException();
this.pushName = pushName;
this.popName = popName;
}
示例14
public PrimitiveCoderDescriptor(final Coder coder,
final String defaultReturnValue, final String mismatchMessage) {
super(coder, "push", "pop" + Utils.capitalize(coder.getJavaPrimitive().getSimpleName()));
this.javaPrimitiveClazz = coder.getJavaPrimitive();
this.javaObjectClazz = coder.getJavaClass();
this.defaultReturnValue = defaultReturnValue;
this.primitiveCoderName = coder.getClass().getSimpleName();
this._mismatchMessage = mismatchMessage;
}
示例15
public CoderDescriptor(final Coder coder, final String pushName, final String popName) {
this.coder = coder;
this.coderInstanceName = coder.getClass().getCanonicalName() + ".INST";
if (coderInstanceName == null) throw new NullPointerException();
this.pushName = pushName;
this.popName = popName;
}
示例16
public PrimitiveCoderDescriptor(final Coder coder,
final String defaultReturnValue, final String mismatchMessage) {
super(coder, "push", "pop" + Utils.capitalize(coder.getJavaPrimitive().getSimpleName()));
this.javaPrimitiveClazz = coder.getJavaPrimitive();
this.javaObjectClazz = coder.getJavaClass();
this.defaultReturnValue = defaultReturnValue;
this.primitiveCoderName = coder.getClass().getSimpleName();
this._mismatchMessage = mismatchMessage;
}
示例17
public CoderDescriptor(final Coder coder, final String pushName, final String popName) {
this.coder = coder;
this.coderInstanceName = coder.getClass().getCanonicalName() + ".INST";
if (coderInstanceName == null) throw new NullPointerException();
this.pushName = pushName;
this.popName = popName;
}
示例18
public PrimitiveCoderDescriptor(final Coder coder,
final String defaultReturnValue, final String mismatchMessage) {
super(coder, "push", "pop" + Utils.capitalize(coder.getJavaPrimitive().getSimpleName()));
this.javaPrimitiveClazz = coder.getJavaPrimitive();
this.javaObjectClazz = coder.getJavaClass();
this.defaultReturnValue = defaultReturnValue;
this.primitiveCoderName = coder.getClass().getSimpleName();
this._mismatchMessage = mismatchMessage;
}
示例19
public CoderDescriptor(final Coder coder, final String pushName, final String popName) {
this.coder = coder;
this.coderInstanceName = coder.getClass().getCanonicalName() + ".INST";
if (coderInstanceName == null) throw new NullPointerException();
this.pushName = pushName;
this.popName = popName;
}
示例20
public PrimitiveCoderDescriptor(final Coder coder,
final String defaultReturnValue, final String mismatchMessage) {
super(coder, "push", "pop" + Utils.capitalize(coder.getJavaPrimitive().getSimpleName()));
this.javaPrimitiveClazz = coder.getJavaPrimitive();
this.javaObjectClazz = coder.getJavaClass();
this.defaultReturnValue = defaultReturnValue;
this.primitiveCoderName = coder.getClass().getSimpleName();
this._mismatchMessage = mismatchMessage;
}
示例21
public CoderDescriptor(final Coder coder, final String pushName, final String popName) {
this.coder = coder;
this.coderInstanceName = coder.getClass().getCanonicalName() + ".INST";
if (coderInstanceName == null) throw new NullPointerException();
this.pushName = pushName;
this.popName = popName;
}
示例22
public PrimitiveCoderDescriptor(final Coder coder,
final String defaultReturnValue, final String mismatchMessage) {
super(coder, "push", "pop" + Utils.capitalize(coder.getJavaPrimitive().getSimpleName()));
this.javaPrimitiveClazz = coder.getJavaPrimitive();
this.javaObjectClazz = coder.getJavaClass();
this.defaultReturnValue = defaultReturnValue;
this.primitiveCoderName = coder.getClass().getSimpleName();
this._mismatchMessage = mismatchMessage;
}
示例23
public CoderDescriptor(final Coder coder, final String pushName, final String popName) {
this.coder = coder;
this.coderInstanceName = coder.getClass().getCanonicalName() + ".INST";
if (coderInstanceName == null) throw new NullPointerException();
this.pushName = pushName;
this.popName = popName;
}
示例24
public PrimitiveCoderDescriptor(final Coder coder,
final String defaultReturnValue, final String mismatchMessage) {
super(coder, "push", "pop" + Utils.capitalize(coder.getJavaPrimitive().getSimpleName()));
this.javaPrimitiveClazz = coder.getJavaPrimitive();
this.javaObjectClazz = coder.getJavaClass();
this.defaultReturnValue = defaultReturnValue;
this.primitiveCoderName = coder.getClass().getSimpleName();
this._mismatchMessage = mismatchMessage;
}
示例25
public CoderDescriptor(final Coder coder, final String pushName, final String popName) {
this.coder = coder;
this.coderInstanceName = coder.getClass().getCanonicalName() + ".INST";
if (coderInstanceName == null) throw new NullPointerException();
this.pushName = pushName;
this.popName = popName;
}
示例26
public PrimitiveCoderDescriptor(final Coder coder,
final String defaultReturnValue, final String mismatchMessage) {
super(coder, "push", "pop" + Utils.capitalize(coder.getJavaPrimitive().getSimpleName()));
this.javaPrimitiveClazz = coder.getJavaPrimitive();
this.javaObjectClazz = coder.getJavaClass();
this.defaultReturnValue = defaultReturnValue;
this.primitiveCoderName = coder.getClass().getSimpleName();
this._mismatchMessage = mismatchMessage;
}
示例27
public CoderDescriptor(final Coder coder, final String pushName, final String popName) {
this.coder = coder;
this.coderInstanceName = coder.getClass().getCanonicalName() + ".INST";
if (coderInstanceName == null) throw new NullPointerException();
this.pushName = pushName;
this.popName = popName;
}
示例28
public PrimitiveCoderDescriptor(final Coder coder,
final String defaultReturnValue, final String mismatchMessage) {
super(coder, "push", "pop" + Utils.capitalize(coder.getJavaPrimitive().getSimpleName()));
this.javaPrimitiveClazz = coder.getJavaPrimitive();
this.javaObjectClazz = coder.getJavaClass();
this.defaultReturnValue = defaultReturnValue;
this.primitiveCoderName = coder.getClass().getSimpleName();
this._mismatchMessage = mismatchMessage;
}
示例29
public CoderDescriptor(final Coder coder, final String pushName, final String popName) {
this.coder = coder;
this.coderInstanceName = coder.getClass().getCanonicalName() + ".INST";
if (coderInstanceName == null) throw new NullPointerException();
this.pushName = pushName;
this.popName = popName;
}
示例30
public PrimitiveCoderDescriptor(final Coder coder,
final String defaultReturnValue, final String mismatchMessage) {
super(coder, "push", "pop" + Utils.capitalize(coder.getJavaPrimitive().getSimpleName()));
this.javaPrimitiveClazz = coder.getJavaPrimitive();
this.javaObjectClazz = coder.getJavaClass();
this.defaultReturnValue = defaultReturnValue;
this.primitiveCoderName = coder.getClass().getSimpleName();
this._mismatchMessage = mismatchMessage;
}