Class ViewInvoker
- java.lang.Object
-
- org.shredzone.commons.view.manager.ViewInvoker
-
@ParametersAreNonnullByDefault @Immutable public class ViewInvoker extends Object
Keeps a reference to and invokes a view handler.ViewInvokers
are immutable.- Author:
- Richard "Shred" Körber
-
-
Constructor Summary
Constructors Constructor Description ViewInvoker(Object bean, Method method, org.springframework.core.convert.ConversionService conversionService)
Creates a newViewInvoker
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getBean()
The Spring bean that was annotated withViewHandler
.Method
getMethod()
The target view handler method that was annotated withView
.String
invoke(ViewContext context)
Invokes the view handler.
-
-
-
Constructor Detail
-
ViewInvoker
public ViewInvoker(Object bean, Method method, org.springframework.core.convert.ConversionService conversionService)
Creates a newViewInvoker
.- Parameters:
bean
- target Spring bean to be invokedmethod
- target method to be invokedconversionService
-ConversionService
to be used for parameter conversion
-
-
Method Detail
-
getBean
@Nonnull public Object getBean()
The Spring bean that was annotated withViewHandler
.
-
getMethod
@Nonnull public Method getMethod()
The target view handler method that was annotated withView
.
-
invoke
public String invoke(ViewContext context) throws ViewException
Invokes the view handler.- Parameters:
context
-ViewContext
containing all necessary data for invoking the view- Returns:
- String returned by the view handler. Usually this is a reference to a JSP
that is used for rendering the result. If
null
, the view handler took care for sending a response itself. - Throws:
ViewException
-
-