Class FilterSpringUtil
- java.lang.Object
-
- de.hybris.platform.ycommercewebservices.filter.FilterSpringUtil
-
public class FilterSpringUtil extends java.lang.ObjectUtil class for retrieving spring beans.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TgetSpringBean(javax.servlet.http.HttpServletRequest httpRequest, java.lang.String beanName, java.lang.Class<T> beanClass)Returns the Spring bean with namebeanNameand of typebeanClass.static <T> TgetSpringBean(javax.servlet.ServletContext servletContext, java.lang.String beanName, java.lang.Class<T> beanClass)The same asgetSpringBean(HttpServletRequest, String, Class)but uses ServletContext as the first parameter.
-
-
-
Method Detail
-
getSpringBean
public static <T> T getSpringBean(javax.servlet.http.HttpServletRequest httpRequest, java.lang.String beanName, java.lang.Class<T> beanClass)Returns the Spring bean with namebeanNameand of typebeanClass. If no bean could be resolved for the specified name, the bean is looked up using type.- Type Parameters:
T- type of the bean- Parameters:
httpRequest- the http requestbeanName- name of the bean ornullif it should be automatically resolved using typebeanClass- expected type of the bean- Returns:
- the bean matching the given arguments or
nullif no bean could be resolved
-
getSpringBean
public static <T> T getSpringBean(javax.servlet.ServletContext servletContext, java.lang.String beanName, java.lang.Class<T> beanClass)The same asgetSpringBean(HttpServletRequest, String, Class)but uses ServletContext as the first parameter. It might be used in places, where HttpServletRequest is not available, but ServletContext is.
-
-