Package org.jboss.errai.codegen

Examples of org.jboss.errai.codegen.Parameter


    return marshal(statement, "text/plain");
  }

  public static Statement marshal(Statement statement, String contentType) {
    if (statement instanceof Parameter) {
      Parameter param = (Parameter) statement;
      return marshal(param.getType(), Variable.get(param.getName()), contentType);
    }
    return marshal(statement.getType(), statement, contentType);
  }
View Full Code Here


    }

    // set cookies based on @CookieParams
    if (params.getCookieParameters() != null) {
      for (String cookieName : params.getCookieParameters().keySet()) {
        Parameter cookieParam = params.getCookieParameters().get(cookieName).get(0);

        Statement setCookie = Stmt.loadVariable(cookieParam.getName())
            .if_(BooleanOperator.NotEquals, null)
              .append(Stmt.invokeStatic(Cookies.class, "setCookie", cookieName, marshal(cookieParam)))
            .finish();

        methodBlock.append(setCookie);
View Full Code Here

    List<Parameter> defParams = DefParameters.from(method).getParameters();
    int i = 0;
    for (MetaParameter param : method.getParameters()) {

      Parameter defParam = defParams.get(i++);
      Annotation a = param.getAnnotation(PathParam.class);
      if (a != null) {
        params.add(PathParam.class, ((PathParam) a).value(), defParam);
      }
      else if ((a = param.getAnnotation(QueryParam.class)) != null) {
View Full Code Here

  public Map<String, List<Parameter>> getPathParameters() {
    return parameters.get(PathParam.class);
  }

  public Parameter getPathParameter(String name) {
    Parameter param = getParameterByName(PathParam.class, name);
    if (param == null)
      throw new RuntimeException("No @PathParam found with name:" + name);

    return param;
  }
View Full Code Here

    return parameters.get(type);
  }

  private Parameter getParameterByName(Class<? extends Annotation> type, String name) {
    Parameter param = null;

    if (get(type) != null) {
      List<Parameter> params = get(type).get(name);
      if (params != null && !params.isEmpty()) {
        param = params.get(0);
View Full Code Here

    return marshal(statement, "text/plain");
  }

  public static Statement marshal(Statement statement, String contentType) {
    if (statement instanceof Parameter) {
      Parameter param = (Parameter) statement;
      return marshal(param.getType(), Variable.get(param.getName()), contentType);
    }
    return marshal(statement.getType(), statement, contentType);
  }
View Full Code Here

    return marshal(type, statement, "text/plain");
  }

  public static Statement marshal(Statement statement, String contentType) {
    if (statement instanceof Parameter) {
      Parameter param = (Parameter) statement;
      return marshal(param.getType(), Variable.get(param.getName()), contentType);
    }
    return marshal(statement.getType(), statement, contentType);
  }
View Full Code Here

    return marshal(statement, "text/plain");
  }

  public static Statement marshal(Statement statement, String contentType) {
    if (statement instanceof Parameter) {
      Parameter param = (Parameter) statement;
      return marshal(param.getType(), Variable.get(param.getName()), contentType);
    }
    return marshal(statement.getType(), statement, contentType);
  }
View Full Code Here

    return marshal(type, statement, "text/plain");
  }

  public static Statement marshal(Statement statement, String contentType) {
    if (statement instanceof Parameter) {
      Parameter param = (Parameter) statement;
      return marshal(param.getType(), Variable.get(param.getName()), contentType);
    }
    return marshal(statement.getType(), statement, contentType);
  }
View Full Code Here

    return marshal(statement, "text/plain");
  }

  public static Statement marshal(Statement statement, String contentType) {
    if (statement instanceof Parameter) {
      Parameter param = (Parameter) statement;
      return marshal(param.getType(), Variable.get(param.getName()), contentType);
    }
    return marshal(statement.getType(), statement, contentType);
  }
View Full Code Here

TOP

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

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.