All Downloads are FREE. Search and download functionalities are using the official Maven repository.

uk.ac.ceh.dynamo.arguments.RequestParamResolver Maven / Gradle / Ivy

Go to download

A Spring MVC plugin for creating dynamic MapServer maps with freemarker templates

There is a newer version: 1.3
Show newest version
package uk.ac.ceh.dynamo.arguments;

import java.util.Collections;
import java.util.Set;
import org.springframework.core.MethodParameter;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * An instance of a QueryParameterResolver which will process @RequestParam
 * annotations to obtain their query param value
 * @see RequestParam
 * @author Christopher Johnson
 */
public class RequestParamResolver implements QueryParameterResolver {

    @Override
    public boolean supportsParameter(MethodParameter methodParameter) {
        return methodParameter.hasParameterAnnotation(RequestParam.class);
    }

    @Override
    public Set getUtilisedQueryParameters(MethodParameter methodParameter) {
        return Collections.singleton(methodParameter
                .getParameterAnnotation(RequestParam.class).value());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy