Package org.jboss.errai.codegen.framework.builder

Examples of org.jboss.errai.codegen.framework.builder.BlockBuilder


    for (MetaMethod method : toProxy.getMethods()) {
      if (method.getDeclaringClass().getFullyQualifiedName().equals("java.lang.Object")) continue;
     
      DefParameters defParameters = DefParameters.from(method);
      BlockBuilder methBody = builder.publicMethod(method.getReturnType(), method.getName()).parameters(defParameters)
              .body();

      List<Parameter> parms = defParameters.getParameters();

      Statement[] statementVars = new Statement[parms.size()];
      for (int i = 0; i < parms.size(); i++) {
        statementVars[i] = Stmt.loadVariable(parms.get(i).getName());
      }

      if (method.getReturnType().isVoid()) {
        methBody.append(Stmt.loadVariable(proxyVar).invoke(method, statementVars));
      }
      else {
        methBody.append(Stmt.loadVariable(proxyVar).invoke(method, statementVars).returnValue());
      }
      methBody.finish();
    }
   
    builder.publicMethod(void.class, PROXY_BIND_METHOD).parameters(DefParameters.of(Parameter.of(toProxy, "proxy")))
            .append(Stmt.loadVariable(proxyVar).assignValue(Stmt.loadVariable("proxy"))).finish();
View Full Code Here

TOP

Related Classes of org.jboss.errai.codegen.framework.builder.BlockBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.