@Override public Collection<MetaClass> provideTypesToExpose() { final Set<MetaClass> types = new HashSet<MetaClass>(); for (final MetaClass metaClass : ClassScanner.getTypesAnnotatedWith(Remote.class)) { for (final MetaMethod method : metaClass.getDeclaredMethods()) { if (!method.getReturnType().isVoid()) { types.add(method.getReturnType().getErased()); } for (final MetaParameter parameter : method.getParameters()) { final MetaClass type = parameter.getType(); types.add(type.getErased()); final MetaParameterizedType parameterizedType = type.getParameterizedType(); if (parameterizedType != null) { for (final MetaType tp : parameterizedType.getTypeParameters()) { if (tp instanceof MetaClass) { types.add(((MetaClass) tp).getErased()); } } } } } } return types; } }
public static String methodAccess(final MetaMethod method) { final StringBuilder buf = new StringBuilder(50); if (!method.getReturnType().isVoid()) { buf.append("return "); } if (!method.isStatic()) { buf.append("instance."); } buf.append('@').append(method.getDeclaringClass().getFullyQualifiedName().replace('$', '.')) .append("::").append(method instanceof MetaConstructor ? "new" : method.getName()).append('('); for (final MetaParameter parm : method.getParameters()) { buf.append(parm.getType().getInternalName()); } buf.append(")("); final int length = method.getParameters().length; for (int i = 0; i < length; i++) { buf.append("a").append(i); if (i + 1 < length) buf.append(","); } buf.append(")"); return buf.toString(); } }
public static String methodAccess(final MetaMethod method) { final StringBuilder buf = new StringBuilder(50); if (!method.getReturnType().isVoid()) { buf.append("return "); } if (!method.isStatic()) { buf.append("instance."); } buf.append('@').append(method.getDeclaringClass().getFullyQualifiedName().replace('$', '.')) .append("::").append(method instanceof MetaConstructor ? "new" : method.getName()).append('('); for (final MetaParameter parm : method.getParameters()) { buf.append(parm.getType().getInternalName()); } buf.append(")("); final int length = method.getParameters().length; for (int i = 0; i < length; i++) { buf.append("a").append(i); if (i + 1 < length) buf.append(","); } buf.append(")"); return buf.toString(); } }
@Override public Collection<MetaClass> provideTypesToExpose() { final Set<MetaClass> types = new HashSet<MetaClass>(); for (final MetaClass metaClass : ClassScanner.getTypesAnnotatedWith(Remote.class)) { for (final MetaMethod method : metaClass.getDeclaredMethods()) { if (!method.getReturnType().isVoid()) { types.add(method.getReturnType().getErased()); } for (final MetaParameter parameter : method.getParameters()) { final MetaClass type = parameter.getType(); types.add(type.getErased()); final MetaParameterizedType parameterizedType = type.getParameterizedType(); if (parameterizedType != null) { for (final MetaType tp : parameterizedType.getTypeParameters()) { if (tp instanceof MetaClass) { types.add(((MetaClass) tp).getErased()); } } } } } } return types; } }
System.arraycopy(statementVars, 0, privateAccessStmts, 1, statementVars.length); if (method.getReturnType().isVoid()) { ifBody._(loadVariable("this").invoke(PrivateAccessUtil.getPrivateMethodName(method), privateAccessStmts)); if (method.getReturnType().isVoid()) { ifBody._(loadVariable(proxyVar).invoke(method, statementVars)); if (!method.getReturnType().isVoid()) { elseBody.append(ProxyUtil.generateProxyMethodReturnStatement(method));
.invoke("invoke", method.isStatic() ? null : Refs.get("instance"), args); if (method.getReturnType().isVoid()) { tryBuilder._(statementBuilder);
.invoke("invoke", method.isStatic() ? null : Refs.get("instance"), args); if (method.getReturnType().isVoid()) { tryBuilder._(statementBuilder);
System.arraycopy(statementVars, 0, privateAccessStmts, 1, statementVars.length); if (method.getReturnType().isVoid()) { ifBody._(loadVariable("this").invoke(PrivateAccessUtil.getPrivateMethodName(method), privateAccessStmts)); if (method.getReturnType().isVoid()) { ifBody._(loadVariable(proxyVar).invoke(method, statementVars)); if (!method.getReturnType().isVoid()) { elseBody.append(ProxyUtil.generateProxyMethodReturnStatement(method));
.append(proxiedInstanceDeclaration) .appendAll(controller.getInvokeBeforeStatements(method)); if (method.getReturnType().isVoid()) { ifBlock.append(proxyHelperInvocation); ifBlock.appendAll(controller.getInvokeAfterStatements(method));
final boolean hasReturnType = !method.getReturnType().isVoid(); final Statement methodInvocation = Stmt.nestedCall(Stmt.loadVariable("instance")).invoke(method.getName(), (Object[]) objects); final Statement invocation = (hasReturnType) ? Stmt.declareFinalVariable("ret", method.getReturnType(), methodInvocation) : methodInvocation;
final boolean hasReturnType = !method.getReturnType().isVoid(); final Statement methodInvocation = Stmt.nestedCall(Stmt.loadVariable("instance")).invoke(method.getName(), (Object[]) objects); final Statement invocation = (hasReturnType) ? Stmt.declareFinalVariable("ret", method.getReturnType(), methodInvocation) : methodInvocation;