for (JParameter p : m.getParameters()) { stub.parameterTypes.add(getType(p.getType())); stub.jnsi += p.getType().getErasedType().getJNISignature(); String paramName = (p.getName() + "__" + p.getType().getErasedType().getJNISignature()).replaceAll( "[/;\\[\\]]", "_"); String paramInstantiation = "new Parameter(\"" + p.getName() + "\", " + getType(p.getType()) + ", \"" + p.getType().getJNISignature() + "\")"; parameterName2ParameterInstantiation.put(paramName, paramInstantiation); pbn(paramName + "(), ");
for (JParameter p : m.getParameters()) { stub.parameterTypes.add(getType(p.getType())); stub.jnsi += p.getType().getErasedType().getJNISignature(); String paramName = (p.getName() + "__" + p.getType().getErasedType().getJNISignature()).replaceAll( "[/;\\[\\]]", "_"); String paramInstantiation = "new Parameter(\"" + p.getName() + "\", " + getType(p.getType()) + ", \"" + p.getType().getJNISignature() + "\")"; parameterName2ParameterInstantiation.put(paramName, paramInstantiation); pbn(paramName + "(), ");
@Override public String convert( int index, JType type ) { return type.getJNISignature(); } } );
protected boolean isReturnable(final JType returnType) { return !"V".equals(returnType.getJNISignature()); }
protected boolean isReturnable(JType returnType) { return !"V".equals(returnType.getJNISignature()); }
@Override public String getInternalName() { return getEnclosedMetaObject().getJNISignature(); }
@Override public String getInternalName() { return getEnclosedMetaObject().getJNISignature(); }
private String createSignature(JMethod method) { StringBuffer sb = new StringBuffer(method.getName()); sb.append('('); for (JParameter param : method.getParameters()) { sb.append(param.getType().getJNISignature()); } sb.append(')'); sb.append(method.getReturnType().getJNISignature()); String signature = sb.toString(); return signature; } }
private String createSignature(JMethod method) { StringBuffer sb = new StringBuffer(method.getName()); sb.append('('); for (JParameter param : method.getParameters()) { sb.append(param.getType().getJNISignature()); } sb.append(')'); sb.append(method.getReturnType().getJNISignature()); String signature = sb.toString(); return signature; } }
/** * @param method * @return JNI signature of the method */ private String getSignature(JMethod method) { StringBuilder buf = new StringBuilder(); buf.append(method.getName()).append('('); for (JParameter param : method.getParameters()) { JType type = param.getType(); buf.append(type.getJNISignature()); } return buf.append(')').toString(); } }
/** * @param method * @return JNI signature of the method */ private String getSignature(JMethod method) { StringBuilder buf = new StringBuilder(); buf.append(method.getName()).append('('); for (JParameter param : method.getParameters()) { JType type = param.getType(); buf.append(type.getJNISignature()); } return buf.append(')').toString(); } }
public String getJSNIParams(JMethod method) { String reference = "("; JParameter[] params = method.getParameters(); for (int i = 0; i < params.length; i++) { reference += params[i].getType().getJNISignature(); } reference += ")"; return reference; }
public static Class<?> getPrimitiveOrClass(final JParameter parm) { final JType type = parm.getType(); final String name = type.isArray() != null ? type.getJNISignature().replace("/", ".") : type.getQualifiedSourceName();
public static Class<?> getPrimitiveOrClass(final JParameter parm) { final JType type = parm.getType(); final String name = type.isArray() != null ? type.getJNISignature().replace("/", ".") : type.getQualifiedSourceName();
public void setDeclarationMethod(JClassType contextType, JMethod declarationMethod) { toReturn.declarationMethod = declarationMethod; JClassType returnClass = declarationMethod.getReturnType().isClassOrInterface(); JsonRpcWireName annotation = returnClass == null ? null : returnClass.getAnnotation(JsonRpcWireName.class); if (annotation == null) { StringBuilder sb = new StringBuilder("("); for (JType type : declarationMethod.getParameterTypes()) { sb.append(type.getJNISignature()); } // Return type ignored sb.append(")V"); toReturn.operation = new OperationKey(contextType.getQualifiedBinaryName(), declarationMethod.getName(), sb .toString()).get(); } else { toReturn.operation = annotation.value(); toReturn.apiVersion = annotation.version(); } }
public void setDeclarationMethod(JClassType contextType, JMethod declarationMethod) { toReturn.declarationMethod = declarationMethod; JClassType returnClass = declarationMethod.getReturnType().isClassOrInterface(); JsonRpcWireName annotation = returnClass == null ? null : returnClass.getAnnotation(JsonRpcWireName.class); if (annotation == null) { StringBuilder sb = new StringBuilder("("); for (JType type : declarationMethod.getParameterTypes()) { sb.append(type.getJNISignature()); } // Return type ignored sb.append(")V"); toReturn.operation = new OperationKey(contextType.getQualifiedBinaryName(), declarationMethod.getName(), sb .toString()).get(); } else { toReturn.operation = annotation.value(); toReturn.apiVersion = annotation.version(); } }
srcWriter.print("::deserialize(L" + SerializationStreamReader.class.getName().replace('.', '/') + ";" + paramType.getJNISignature() + ")"); + ";" + paramType.getJNISignature() + ")"); srcWriter.println();
@Override public JClassType execute() throws UnableToCompleteException { for (JMethod method : callbackType.getOverridableMethods()) { getLogger().log(DEBUG, "checking method: " + method.getName()); if (method.getName().equals("onSuccess")) { JParameter[] parameters = method.getParameters(); getLogger().log(DEBUG, "checking method params: " + parameters.length); if (parameters.length == 2) { getLogger().log(DEBUG, "checking first param: " + parameters[0].getType()); if (parameters[0].getType() == METHOD_TYPE) { getLogger().log(DEBUG, "checking 2nd param: " + parameters[1].getType()); JType param2Type = parameters[1].getType(); JClassType type = param2Type.isClassOrInterface(); if (type == null) { getLogger().log(ERROR, "The type of the callback not supported: " + param2Type.getJNISignature()); throw new UnableToCompleteException(); } getLogger().log(DEBUG, "match: " + type); return type; } } } } getLogger().log(ERROR, "The type of the callback could not be determined: " + callbackType.getParameterizedQualifiedSourceName()); throw new UnableToCompleteException(); } });
for (JParameter p : m.getParameters()) { stub.parameterTypes.add(getType(p.getType())); stub.jnsi += p.getType().getErasedType().getJNISignature(); pb("new Parameter(\"" + p.getName() + "\", " + getType(p.getType()) + ", \"" + p.getType().getJNISignature() + "\"), ");
@Override public JClassType execute() throws UnableToCompleteException { for (JMethod method : callbackType.getOverridableMethods()) { getLogger().log(DEBUG, "checking method: " + method.getName()); if (method.getName().equals("onSuccess")) { JParameter[] parameters = method.getParameters(); getLogger().log(DEBUG, "checking method params: " + parameters.length); if (parameters.length == 2) { getLogger().log(DEBUG, "checking first param: " + parameters[0].getType()); if (parameters[0].getType() == METHOD_TYPE) { getLogger().log(DEBUG, "checking 2nd param: " + parameters[1].getType()); JType param2Type = parameters[1].getType(); JClassType type = param2Type.isClassOrInterface(); if (type == null) { getLogger().log(ERROR, "The type of the callback not supported: " + param2Type.getJNISignature()); throw new UnableToCompleteException(); } getLogger().log(DEBUG, "match: " + type); return type; } } } } getLogger().log(ERROR, "The type of the callback could not be determined: " + callbackType.getParameterizedQualifiedSourceName()); throw new UnableToCompleteException(); } });