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

com.v5analytics.webster.parameterProviders.ServletRequestParameterProviderFactory Maven / Gradle / Ivy

The newest version!
package com.v5analytics.webster.parameterProviders;

import com.v5analytics.webster.HandlerChain;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;

public class ServletRequestParameterProviderFactory extends ParameterProviderFactory {
    public static final ParameterProvider PARAMETER_PROVIDER = new ParameterProvider() {
        @Override
        public ServletRequest getParameter(HttpServletRequest request, HttpServletResponse response, HandlerChain chain) {
            return request;
        }
    };

    @Override
    public boolean isHandled(Method handleMethod, Class parameterType, java.lang.annotation.Annotation[] parameterAnnotations) {
        return ServletRequest.class.isAssignableFrom(parameterType);
    }

    @Override
    public ParameterProvider createParameterProvider(Method handleMethod, Class parameterType, java.lang.annotation.Annotation[] parameterAnnotations) {
        return PARAMETER_PROVIDER;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy