Package org.restsql.core

Examples of org.restsql.core.RequestValue


        final String element = (String) tokenizer.nextElement();
        if (params == null) {
          params = new ArrayList<RequestValue>(4);
        }
        final int equalsIndex = element.indexOf('=');
        params.add(new RequestValue(element.substring(0, equalsIndex), element
            .substring(equalsIndex + 1)));
      }
    }

    RequestUtil.checkForInvalidMultipleParameters(params);
View Full Code Here


  }

  @Override
  public void extractParameters() throws InvalidRequestException {
    if (params != null && params.size() > 0) {
      RequestValue selectLimitRequestValue = null, selectOffsetRequestValue = null;
      for (final RequestValue requestValue : params) {
        // Extract limit and offset
        if (requestValue.getName().equalsIgnoreCase(Request.PARAM_NAME_LIMIT)) {
          selectLimitRequestValue = setSelectLimitOrOffset(Request.PARAM_NAME_LIMIT, requestValue);
        } else if (requestValue.getName().equalsIgnoreCase(Request.PARAM_NAME_OFFSET)) {
View Full Code Here

    }

    /** Sets string, number or boolean value to current parameter. */
    @Override
    public boolean primitive(final Object value) throws ParseException, IOException {
      RequestValue pair;
      if (value != null) {
        pair = new RequestValue(currentKey, value.toString(), Operator.Equals);
      } else {
        pair = new RequestValue(currentKey, null, Operator.Equals);
      }
      params.add(pair);
      return true;
    }
View Full Code Here

    }

    private List<RequestValue> parseAttributes(final Attributes attributes) {
      final List<RequestValue> requestParams = new ArrayList<RequestValue>(attributes.getLength());
      for (int i = 0; i < attributes.getLength(); i++) {
        final RequestValue param = new RequestValue(attributes.getQName(i), attributes.getValue(i),
            Operator.Equals);
        requestParams.add(param);
      }
      return requestParams;
    }
View Full Code Here

  /** Converts form or query params into a list of NameValuePairs. */
  private List<RequestValue> getNameValuePairs(final MultivaluedMap<String, String> formOrQueryParams) {
    final List<RequestValue> params = new ArrayList<RequestValue>(formOrQueryParams.size());
    for (final String key : formOrQueryParams.keySet()) {
      for (final String value : formOrQueryParams.get(key)) {
        final RequestValue param = new RequestValue(key, value);
        params.add(param);
      }
    }
    return params;
  }
View Full Code Here

TOP

Related Classes of org.restsql.core.RequestValue

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.