Package org.jboss.errai.codegen

Examples of org.jboss.errai.codegen.StringStatement


      instance.annotatedWith(UNSAFE_NATIVE_LONG_ANNOTATION);
    }

    instance.modifiers(appendJsni(modifiers))
            .body()
            ._(new StringStatement("return " + JSNIUtil.fieldAccess(field)))
            .finish();
  }
View Full Code Here


    classBuilder.publicMethod(method.getReturnType(), PrivateAccessUtil.getPrivateMethodName(method))
            .parameters(DefParameters.fromParameters(wrapperDefParms))
            .modifiers(appendJsni(modifiers))
            .body()
            ._(new StringStatement(JSNIUtil.methodAccess(method)))
            .finish();
  }
View Full Code Here

    classBuilder.publicMethod(constructor.getReturnType(), PrivateAccessUtil.getPrivateMethodName(constructor))
            .parameters(methodDefParms)
                    .modifiers(Modifier.Static, Modifier.JSNI)
                    .body()
                    ._(new StringStatement(JSNIUtil.methodAccess(constructor)))
                    .finish();
  }
View Full Code Here

  }

  private Statement generateUrl(JaxrsResourceMethodParameters params) {
    BlockStatement block = new BlockStatement();
    block.addStatement(Stmt.declareVariable("url", StringBuilder.class,
        Stmt.newObject(StringBuilder.class, new StringStatement("getBaseUrl()"))));

    // construct path using @PathParams and @MatrixParams
    String path = resourceMethod.getPath();
    ContextualStatementBuilder pathValue = Stmt.loadLiteral(path);
View Full Code Here

    Statement callContext =
        RPCProxyUtil.generateProxyMethodCallContext(RestCallContext.class, declaringClass,
            resourceMethod.getMethod(), generateInterceptedRequest(), interceptedCall)
            .publicOverridesMethod("setParameters", Parameter.of(Object[].class, "parameters"))
            .append(new StringStatement("super.setParameters(parameters)"))
            .append(generateUrl(jaxrsParams))
            .append(generateRequestBuilder(jaxrsParams))
            .append(generateHeaders(jaxrsParams))
            .append(new StringStatement("setRequestBuilder(requestBuilder)"))
            .finish()
            .finish();

    return Stmt.try_()
            .append(
View Full Code Here

            .finish();
  }

  private Statement generateInterceptedRequest() {
    return generateRequest(Stmt.nestedCall(
        new StringStatement("getRequestBuilder()", MetaClassFactory.get(RequestBuilder.class))));
  }
View Full Code Here

      finalParms[i] = Parameter.of(parms[i].getType(), parms[i].getName(), true);
      parmVars.add(Stmt.loadVariable(parms[i].getName()));
    }

    Statement parameters = (intercepted) ?
        new StringStatement("getParameters()", MetaClassFactory.get(Object[].class)) :
          Stmt.newArray(Object.class).initialize(parmVars.toArray());

    BlockBuilder<?> methodBlock =
        classBuilder.publicMethod(method.getReturnType(), method.getName(), finalParms);
View Full Code Here

   * @return the URL statement
   */
  private Statement generateUrl(final JaxrsResourceMethodParameters params) {
    BlockStatement block = new BlockStatement();
    block.addStatement(Stmt.declareVariable("url", StringBuilder.class,
        Stmt.newObject(StringBuilder.class, new StringStatement("getBaseUrl()"))));

    // construct path using @PathParams and @MatrixParams
    String path = resourceMethod.getPath();
    ContextualStatementBuilder pathValue = Stmt.loadLiteral(path);

View Full Code Here

                      .finish())
              )
              .append(Stmt.loadVariable("this").invoke("proceed", Variable.get("interceptorCallback")))
            .finish()
            .publicOverridesMethod("setParameters", Parameter.of(Object[].class, "parameters"))
              .append(new StringStatement("super.setParameters(parameters)"))
              .append(generateUrl(jaxrsParams))
              .append(generateRequestBuilder())
              .append(generateHeaders(jaxrsParams))
              .append(new StringStatement("setRequestBuilder(requestBuilder)"))
            .finish()
            .finish();

    return Stmt.try_()
            .append(
View Full Code Here

   *
   * @return statement representing the request
   */
  private Statement generateInterceptedRequest() {
    return generateRequest(
            Stmt.nestedCall(new StringStatement("getRequestBuilder()", MetaClassFactory.get(RequestBuilder.class))),
            Stmt.loadStatic(declaringClass, "this"));
  }
View Full Code Here

TOP

Related Classes of org.jboss.errai.codegen.StringStatement

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.