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

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


        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()),
        new ProducesRequestCondition(annotation.produces(), annotation.headers(), getContentNegotiationManager()),
        customCondition);
  }
View Full Code Here


        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()),
        new ProducesRequestCondition(annotation.produces(), annotation.headers()),
        customCondition);
  }
View Full Code Here

                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();
    this.customConditionHolder = new RequestConditionHolder(custom);
  }
View Full Code Here

  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);
    RequestConditionHolder custom = this.customConditionHolder.combine(other.customConditionHolder);

    return new RequestMappingInfo(patterns, methods, params, headers, consumes, produces, custom.getCondition());
  }
View Full Code Here

   */
  public RequestMappingInfo getMatchingCondition(HttpServletRequest request) {
    RequestMethodsRequestCondition methods = methodsCondition.getMatchingCondition(request);
    ParamsRequestCondition params = paramsCondition.getMatchingCondition(request);
    HeadersRequestCondition headers = headersCondition.getMatchingCondition(request);
    ConsumesRequestCondition consumes = consumesCondition.getMatchingCondition(request);
    ProducesRequestCondition produces = producesCondition.getMatchingCondition(request);
   
    if (methods == null || params == null || headers == null || consumes == null || produces == null) {
      return null;
    }
View Full Code Here

  @Override
  public void execute(RequestMappingContext context) {
    SwaggerGlobalSettings swaggerGlobalSettings = (SwaggerGlobalSettings) context.get("swaggerGlobalSettings");

    RequestMappingInfo requestMappingInfo = context.getRequestMappingInfo();
    ConsumesRequestCondition consumesCondition = requestMappingInfo.getConsumesCondition();
    ProducesRequestCondition producesRequestCondition = requestMappingInfo.getProducesCondition();

    Set<MediaType> consumesMediaTypes = consumesCondition.getConsumableMediaTypes();
    Set<MediaType> producesMediaTypes = producesRequestCondition.getProducibleMediaTypes();

    List<String> consumesList = toList(consumesMediaTypes);
    List<String> producesList = toList(producesMediaTypes);
View Full Code Here

        new PatternsRequestCondition(patterns, 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()),
        new ProducesRequestCondition(annotation.produces(), annotation.headers(), this.contentNegotiationManager),
        customCondition);
  }
View Full Code Here

    this.name = (StringUtils.hasText(name) ? name : null);
    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());
    this.customConditionHolder = new RequestConditionHolder(custom);
  }
View Full Code Here

    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);

    return new RequestMappingInfo(name, patterns,
        methods, params, headers, consumes, produces, custom.getCondition());
View Full Code Here

  @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) {
      return null;
    }
View Full Code Here

TOP

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

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.