|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object GenericPortlet org.springframework.web.portlet.GenericPortletBean
public abstract class GenericPortletBean
Simple extension of javax.portlet.GenericPortlet
that treats
its config parameters as bean properties.
A very handy superclass for any type of portlet. Type conversion is automatic. It is also possible for subclasses to specify required properties.
This portlet leaves request handling to subclasses, inheriting the default
behaviour of GenericPortlet (doDispatch
, processAction
, etc).
This portlet superclass has no dependency on a Spring application context, in contrast to the FrameworkPortlet class which loads its own context.
addRequiredProperty(java.lang.String)
,
initPortletBean()
,
#doDispatch
,
#processAction
,
FrameworkPortlet
Nested Class Summary | |
---|---|
private static class |
GenericPortletBean.PortletConfigPropertyValues
PropertyValues implementation created from PortletConfig init parameters. |
Field Summary | |
---|---|
private Environment |
environment
|
protected Log |
logger
Logger available to subclasses |
private java.util.Set<java.lang.String> |
requiredProperties
Set of required properties (Strings) that must be supplied as config parameters to this portlet. |
Constructor Summary | |
---|---|
GenericPortletBean()
|
Method Summary | |
---|---|
protected void |
addRequiredProperty(java.lang.String property)
Subclasses can invoke this method to specify that this property (which must match a JavaBean property they expose) is mandatory, and must be supplied as a config parameter. |
PortletContext |
getPortletContext()
Overridden method that simply returns null when no
PortletConfig set yet. |
java.lang.String |
getPortletName()
Overridden method that simply returns null when no
PortletConfig set yet. |
void |
init()
Map config parameters onto bean properties of this portlet, and invoke subclass initialization. |
protected void |
initBeanWrapper(BeanWrapper bw)
Initialize the BeanWrapper for this GenericPortletBean, possibly with custom editors. |
protected void |
initPortletBean()
Subclasses may override this to perform custom initialization. |
void |
setEnvironment(Environment environment)
Set the Environment that this object runs in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log logger
private final java.util.Set<java.lang.String> requiredProperties
private Environment environment
Constructor Detail |
---|
public GenericPortletBean()
Method Detail |
---|
protected final void addRequiredProperty(java.lang.String property)
property
- name of the required propertypublic final void init() throws PortletException
PortletException
- if bean properties are invalid (or required
properties are missing), or if subclass initialization fails.protected void initBeanWrapper(BeanWrapper bw) throws BeansException
bw
- the BeanWrapper to initialize
BeansException
- if thrown by BeanWrapper methodsPropertyEditorRegistry.registerCustomEditor(java.lang.Class>, java.beans.PropertyEditor)
public final java.lang.String getPortletName()
null
when no
PortletConfig set yet.
#getPortletConfig()
public final PortletContext getPortletContext()
null
when no
PortletConfig set yet.
#getPortletConfig()
protected void initPortletBean() throws PortletException
PortletException
- if subclass initialization failspublic void setEnvironment(Environment environment)
Environment
that this object runs in.
Any environment set here overrides the StandardPortletEnvironment
provided by default.
setEnvironment
in interface EnvironmentAware
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |