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

Examples of org.jboss.errai.codegen.framework.builder.ContextualStatementBuilder.invoke()


    List<String> pathParams =
        ((UriBuilderImpl) UriBuilderImpl.fromTemplate(resourceMethod.getPath())).getPathParamNamesInDeclarationOrder();
    int i = 0;
    for (String pathParam : pathParams) {
      pathValue = pathValue.invoke("replaceFirst", "\\{" + pathParam + "\\}",
          marshal(params.getPathParameter(pathParam, i++)));
    }

    methodBlock.append(Stmt.declareVariable("url", StringBuilder.class,
        Stmt.newObject(StringBuilder.class).withParameters(pathValue)));
View Full Code Here


      i = 0;
      for (String queryParamName : params.getQueryParameters().keySet()) {
        for (Parameter queryParam : params.getQueryParameters(queryParamName)) {
          if (i++ > 0)
            urlBuilder = urlBuilder.invoke(APPEND, "&");

          urlBuilder = urlBuilder.invoke(APPEND, queryParamName);
          urlBuilder = urlBuilder.invoke(APPEND, "=");
          urlBuilder = urlBuilder.invoke(APPEND, marshal(queryParam));
        }
View Full Code Here

      for (String queryParamName : params.getQueryParameters().keySet()) {
        for (Parameter queryParam : params.getQueryParameters(queryParamName)) {
          if (i++ > 0)
            urlBuilder = urlBuilder.invoke(APPEND, "&");

          urlBuilder = urlBuilder.invoke(APPEND, queryParamName);
          urlBuilder = urlBuilder.invoke(APPEND, "=");
          urlBuilder = urlBuilder.invoke(APPEND, marshal(queryParam));
        }
      }
    }
View Full Code Here

        for (Parameter queryParam : params.getQueryParameters(queryParamName)) {
          if (i++ > 0)
            urlBuilder = urlBuilder.invoke(APPEND, "&");

          urlBuilder = urlBuilder.invoke(APPEND, queryParamName);
          urlBuilder = urlBuilder.invoke(APPEND, "=");
          urlBuilder = urlBuilder.invoke(APPEND, marshal(queryParam));
        }
      }
    }
   
View Full Code Here

          if (i++ > 0)
            urlBuilder = urlBuilder.invoke(APPEND, "&");

          urlBuilder = urlBuilder.invoke(APPEND, queryParamName);
          urlBuilder = urlBuilder.invoke(APPEND, "=");
          urlBuilder = urlBuilder.invoke(APPEND, marshal(queryParam));
        }
      }
    }
   
    // TODO MatrixParams
View Full Code Here

        ContextualStatementBuilder headerValueBuilder = Stmt.nestedCall(Stmt.newObject(StringBuilder.class));
       
        int i = 0;
        for (Parameter headerParam : params.getHeaderParameters(headerParamName)) {
          if (i++ > 0) {
            headerValueBuilder = headerValueBuilder.invoke(APPEND, ",");
          }
          headerValueBuilder = headerValueBuilder.invoke(APPEND, marshal(headerParam));
        }

        methodBlock.append(Stmt.loadVariable("requestBuilder").invoke("setHeader", headerParamName,
View Full Code Here

        int i = 0;
        for (Parameter headerParam : params.getHeaderParameters(headerParamName)) {
          if (i++ > 0) {
            headerValueBuilder = headerValueBuilder.invoke(APPEND, ",");
          }
          headerValueBuilder = headerValueBuilder.invoke(APPEND, marshal(headerParam));
        }

        methodBlock.append(Stmt.loadVariable("requestBuilder").invoke("setHeader", headerParamName,
            headerValueBuilder.invoke("toString")));
      }
View Full Code Here

          }
          headerValueBuilder = headerValueBuilder.invoke(APPEND, marshal(headerParam));
        }

        methodBlock.append(Stmt.loadVariable("requestBuilder").invoke("setHeader", headerParamName,
            headerValueBuilder.invoke("toString")));
      }
    }
   
    // TODO CookieParams
  }
View Full Code Here

  }

  private void generateRequest(BlockBuilder<?> methodBlock) {
    ContextualStatementBuilder sendRequest = Stmt.loadVariable("requestBuilder");
    if (resourceMethod.getParameters().getEntityParameter() == null) {
      sendRequest = sendRequest.invoke("sendRequest", null, generateRequestCallback());
    }
    else {
      Statement body = marshal(resourceMethod.getParameters().getEntityParameter());
      sendRequest = sendRequest.invoke("sendRequest", body, generateRequestCallback());
    }
View Full Code Here

    if (resourceMethod.getParameters().getEntityParameter() == null) {
      sendRequest = sendRequest.invoke("sendRequest", null, generateRequestCallback());
    }
    else {
      Statement body = marshal(resourceMethod.getParameters().getEntityParameter());
      sendRequest = sendRequest.invoke("sendRequest", body, generateRequestCallback());
    }

    methodBlock.append(Stmt
        .try_()
        .append(sendRequest)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.