uk.ac.ceh.dynamo.arguments.RequestParamResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dynamo-mapping Show documentation
Show all versions of dynamo-mapping Show documentation
A Spring MVC plugin for creating dynamic MapServer maps with freemarker templates
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());
}
}