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

org.visallo.webster.parameterProviders.ServletResponseParameterProviderFactory Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
package org.visallo.webster.parameterProviders;

import org.visallo.webster.HandlerChain;

import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy