com.v5analytics.webster.parameterProviders.ServletRequestParameterProviderFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webster Show documentation
Show all versions of webster Show documentation
Minimalist web framework, that has an express.js like API.
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 extends ServletRequest> 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;
}
}