Package org.springframework.web.servlet.mvc.condition

Examples of org.springframework.web.servlet.mvc.condition.ParamsRequestCondition$ParamExpression


  @Override
  public RequestMappingInfo combine(RequestMappingInfo other) {
    String name = combineNames(other);
    PatternsRequestCondition patterns = this.patternsCondition.combine(other.patternsCondition);
    RequestMethodsRequestCondition methods = this.methodsCondition.combine(other.methodsCondition);
    ParamsRequestCondition params = this.paramsCondition.combine(other.paramsCondition);
    HeadersRequestCondition headers = this.headersCondition.combine(other.headersCondition);
    ConsumesRequestCondition consumes = this.consumesCondition.combine(other.consumesCondition);
    ProducesRequestCondition produces = this.producesCondition.combine(other.producesCondition);
    RequestConditionHolder custom = this.customConditionHolder.combine(other.customConditionHolder);
View Full Code Here


   * @return a new instance in case all conditions match; or {@code null} otherwise
   */
  @Override
  public RequestMappingInfo getMatchingCondition(HttpServletRequest request) {
    RequestMethodsRequestCondition methods = this.methodsCondition.getMatchingCondition(request);
    ParamsRequestCondition params = this.paramsCondition.getMatchingCondition(request);
    HeadersRequestCondition headers = this.headersCondition.getMatchingCondition(request);
    ConsumesRequestCondition consumes = this.consumesCondition.getMatchingCondition(request);
    ProducesRequestCondition produces = this.producesCondition.getMatchingCondition(request);

    if (methods == null || params == null || headers == null || consumes == null || produces == null) {
View Full Code Here

    request.setParameter("foo", "bar");

    RequestMappingInfo info =
        new RequestMappingInfo(
            new PatternsRequestCondition("/foo"), null,
            new ParamsRequestCondition("foo=bar"), null, null, null, null);
    RequestMappingInfo match = info.getMatchingCondition(request);

    assertNotNull(match);

    info = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"), null,
        new ParamsRequestCondition("foo!=bar"), null, null, null, null);
    match = info.getMatchingCondition(request);

    assertNull(match);
  }
View Full Code Here

    request.setParameter("foo", "bar");

    RequestMappingInfo info =
        new RequestMappingInfo(
            new PatternsRequestCondition("/foo"), null, null, null, null, null,
            new ParamsRequestCondition("foo=bar"));
    RequestMappingInfo match = info.getMatchingCondition(request);

    assertNotNull(match);

    info = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"), null,
        new ParamsRequestCondition("foo!=bar"), null, null, null,
        new ParamsRequestCondition("foo!=bar"));
    match = info.getMatchingCondition(request);

    assertNull(match);
  }
View Full Code Here

      new RequestMappingInfo(null,
          new RequestMethodsRequestCondition(RequestMethod.GET), null, null, null, null, null);
    RequestMappingInfo oneMethodOneParam =
        new RequestMappingInfo(null,
            new RequestMethodsRequestCondition(RequestMethod.GET),
            new ParamsRequestCondition("foo"), null, null, null, null);

    Comparator<RequestMappingInfo> comparator = new Comparator<RequestMappingInfo>() {
      @Override
      public int compare(RequestMappingInfo info, RequestMappingInfo otherInfo) {
        return info.compareTo(otherInfo, new MockHttpServletRequest());
View Full Code Here

  @Test
  public void equals() {
    RequestMappingInfo info1 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    RequestMappingInfo info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertEquals(info1, info2);
    assertEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo", "/NOOOOOO"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET, RequestMethod.POST),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("/NOOOOOO"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("/NOOOOOO"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/NOOOOOO"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/NOOOOOO"),
        new ParamsRequestCondition("customFoo=customBar"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());

    info2 = new RequestMappingInfo(
        new PatternsRequestCondition("/foo"),
        new RequestMethodsRequestCondition(RequestMethod.GET),
        new ParamsRequestCondition("foo=bar"),
        new HeadersRequestCondition("foo=bar"),
        new ConsumesRequestCondition("text/plain"),
        new ProducesRequestCondition("text/plain"),
        new ParamsRequestCondition("customFoo=NOOOOOO"));

    assertFalse(info1.equals(info2));
    assertNotEquals(info1.hashCode(), info2.hashCode());
  }
View Full Code Here

      RequestMapping annotation = AnnotationUtils.findAnnotation(method, RequestMapping.class);
      if (annotation != null) {
        return new RequestMappingInfo(
          new PatternsRequestCondition(annotation.value(), getUrlPathHelper(), getPathMatcher(), true, true),
          new RequestMethodsRequestCondition(annotation.method()),
          new ParamsRequestCondition(annotation.params()),
          new HeadersRequestCondition(annotation.headers()),
          new ConsumesRequestCondition(annotation.consumes(), annotation.headers()),
          new ProducesRequestCondition(annotation.produces(), annotation.headers()), null);
      }
      else {
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.mvc.condition.ParamsRequestCondition$ParamExpression

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.