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

Examples of org.springframework.web.servlet.mvc.condition.PatternsRequestCondition


            for (String pattern : defaultPatterns) {
                patterns[i] = prefix + pattern;
                i++;
            }
        }
        PatternsRequestCondition patternsInfo = new PatternsRequestCondition(patterns);

        RequestMappingInfo modified = new RequestMappingInfo(patternsInfo,
                mapping.getMethodsCondition(), mapping.getParamsCondition(),
                mapping.getHeadersCondition(), mapping.getConsumesCondition(),
                mapping.getProducesCondition(), mapping.getCustomCondition());
View Full Code Here


  /**
   * Created a RequestMappingInfo from a RequestMapping annotation.
   */
  private RequestMappingInfo createRequestMappingInfo(RequestMapping annotation, RequestCondition<?> customCondition) {
    return new RequestMappingInfo(
        new PatternsRequestCondition(annotation.value(), getUrlPathHelper(), getPathMatcher(),
            this.useSuffixPatternMatch, this.useTrailingSlashMatch, this.fileExtensions),
        new RequestMethodsRequestCondition(annotation.method()),
        new ParamsRequestCondition(annotation.params()),
        new HeadersRequestCondition(annotation.headers()),
        new ConsumesRequestCondition(annotation.consumes(), annotation.headers()),
View Full Code Here

  /**
   * Created a RequestMappingInfo from a RequestMapping annotation.
   */
  private RequestMappingInfo createRequestMappingInfo(RequestMapping annotation, RequestCondition<?> customCondition) {
    return new RequestMappingInfo(
        new PatternsRequestCondition(annotation.value(),
            getUrlPathHelper(), getPathMatcher(), this.useSuffixPatternMatch, this.useTrailingSlashMatch),
        new RequestMethodsRequestCondition(annotation.method()),
        new ParamsRequestCondition(annotation.params()),
        new HeadersRequestCondition(annotation.headers()),
        new ConsumesRequestCondition(annotation.consumes(), annotation.headers()),
View Full Code Here

                ParamsRequestCondition params,
                HeadersRequestCondition headers,
                ConsumesRequestCondition consumes,
                ProducesRequestCondition produces,
                RequestCondition<?> custom) {
    this.patternsCondition = patterns != null ? patterns : new PatternsRequestCondition();
    this.methodsCondition = methods != null ? methods : new RequestMethodsRequestCondition();
    this.paramsCondition = params != null ? params : new ParamsRequestCondition();
    this.headersCondition = headers != null ? headers : new HeadersRequestCondition();
    this.consumesCondition = consumes != null ? consumes : new ConsumesRequestCondition();
    this.producesCondition = produces != null ? produces : new ProducesRequestCondition();
View Full Code Here

   * Combines "this" request mapping info (i.e. the current instance) with another request mapping info instance.
   * <p>Example: combine type- and method-level request mappings.
   * @return a new request mapping info instance; never {@code null}
   */
  public RequestMappingInfo combine(RequestMappingInfo 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);
View Full Code Here

   
    if (methods == null || params == null || headers == null || consumes == null || produces == null) {
      return null;
    }
   
    PatternsRequestCondition patterns = patternsCondition.getMatchingCondition(request);
    if (patterns == null) {
      return null;
    }
   
    RequestConditionHolder custom = customConditionHolder.getMatchingCondition(request);
View Full Code Here

                    patterns.add(restResource.path() + (!"/".equals(pattern) ? pattern : ""));
                }

                // create a new mapping based on the patterns (patterns are unmodifiable in existing RequestMappingInfo)
                mapping = new RequestMappingInfo(
                            new PatternsRequestCondition(patterns.toArray(ArrayUtils.EMPTY_STRING_ARRAY),
                                                         getUrlPathHelper(), getPathMatcher(),
                                                         useSuffixPatternMatch(), useTrailingSlashMatch()),
                            mapping.getMethodsCondition(), mapping.getParamsCondition(), mapping.getHeadersCondition(),
                            mapping.getConsumesCondition(), mapping.getProducesCondition(), mapping.getCustomCondition());
            }
View Full Code Here

    }
  }

  private boolean requestMappingMatchesAnIncludePattern(RequestMappingInfo requestMappingInfo,
                                                        HandlerMethod handlerMethod) {
    PatternsRequestCondition patternsCondition = requestMappingInfo.getPatternsCondition();
    boolean isMatch = requestMappingPatternMatcher.patternConditionsMatchOneOfIncluded(patternsCondition,
            includePatterns);
    if (isMatch) {
      return true;
    }
View Full Code Here

  @Override
  public void execute(RequestMappingContext context) {
    RequestMappingInfo requestMappingInfo = context.getRequestMappingInfo();
    HandlerMethod handlerMethod = context.getHandlerMethod();
    PatternsRequestCondition patternsCondition = requestMappingInfo.getPatternsCondition();

    List<ApiDescription> apiDescriptionList = newArrayList();
    for (String pattern : patternsCondition.getPatterns()) {
      String cleanedRequestMappingPath = sanitizeRequestMappingPattern(pattern);
      String path = swaggerPathProvider.getOperationPath(cleanedRequestMappingPath);
      String methodName = handlerMethod.getMethod().getName();
      context.put("requestMappingPattern", cleanedRequestMappingPath);
      ApiOperationReader apiOperationReader = new ApiOperationReader(customAnnotationReaders);
View Full Code Here

  @Override
  protected RequestMappingInfo getMappingForMethod(Method method, Class<?> handlerType) {

    if (method.getName().equals("publishClientJwk") && getJwkPublishUrl() != null) {
      return new RequestMappingInfo(
          new PatternsRequestCondition(new String[] {getJwkPublishUrl()}, getUrlPathHelper(), getPathMatcher(), false, false),
          null,
          null,
          null,
          null,
          null,
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.mvc.condition.PatternsRequestCondition

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.