Example usage for org.springframework.web.servlet.mvc.condition ProducesRequestCondition ProducesRequestCondition

List of usage examples for org.springframework.web.servlet.mvc.condition ProducesRequestCondition ProducesRequestCondition

Introduction

In this page you can find the example usage for org.springframework.web.servlet.mvc.condition ProducesRequestCondition ProducesRequestCondition.

Prototype

private ProducesRequestCondition(List<ProduceMediaTypeExpression> expressions, ProducesRequestCondition other) 

Source Link

Document

Private constructor for internal use to create matching conditions.

Usage

From source file:net.sf.cocmvc.ConventionalHandlerMapping.java

private RequestMappingInfo createRequestMapping(RequestMapping annotation,
        RequestCondition<?> customCondition) {
    return new RequestMappingInfo(createPatternRequestCondition(annotation.value()),
            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);
}

From source file:org.makersoft.mvc.method.annotation.RESTfulMappingHandlerMapping.java

/**
 * Created a RequestMappingInfo from a RequestMapping annotation.
 *//*ww  w. jav  a  2 s  . co m*/
private RequestMappingInfo createRequestMappingInfo(Method method, RESTfull annotation,
        Class<?> controllerClass) {

    Mapping mapping = RESTfulHelper.matchMapping(method.getName());

    if (mapping != null) {
        PackageBasedUrlPathBuilder builder = new PackageBasedUrlPathBuilder(packageLocators, controllerPackages,
                controllerSuffix, root);

        String[] namespaceString = builder.buildUrlPath(controllerClass, mapping.getMethodName(),
                mapping.getValues());
        if (namespaceString != null) {
            return new RequestMappingInfo(
                    new PatternsRequestCondition(namespaceString, getUrlPathHelper(), getPathMatcher(),
                            this.useSuffixPatternMatch, this.useTrailingSlashMatch),
                    new RequestMethodsRequestCondition(mapping.getRequestMethods()),
                    new ParamsRequestCondition(mapping.getParams()),
                    new HeadersRequestCondition(mapping.getHeaders()),
                    new ConsumesRequestCondition(mapping.getConsumes(), mapping.getHeaders()),
                    new ProducesRequestCondition(mapping.getProduces(), mapping.getHeaders()),
                    getCustomMethodCondition(method));
        }

    }

    return null;
}