|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.richclient.form.binding.support.AbstractBinderSelectionStrategy
public abstract class AbstractBinderSelectionStrategy
Default implementation of BinderSelectionStrategy
. Provides for
registering of binders by control type, property type and property name.
Constructor Summary | |
---|---|
AbstractBinderSelectionStrategy(Class defaultControlType)
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
protected Binder |
findBinderByControlType(Class controlType)
Try to find a binder for the provided controlType. |
protected Binder |
findBinderByPropertyName(Class parentObjectType,
String propertyName)
Try to find a binder for the provided parentObjectType and propertyName. |
protected Binder |
findBinderByPropertyType(Class propertyType)
Try to find a binder for the provided propertyType. |
protected ApplicationContext |
getApplicationContext()
|
protected Class |
getPropertyType(FormModel formModel,
String formPropertyPath)
|
protected boolean |
isEnumeration(FormModel formModel,
String formPropertyPath)
|
protected void |
registerBinderForControlType(Class controlType,
Binder binder)
|
protected void |
registerBinderForPropertyName(Class parentObjectType,
String propertyName,
Binder binder)
|
protected void |
registerBinderForPropertyType(Class propertyType,
Binder binder)
|
protected abstract void |
registerDefaultBinders()
Register the default set of binders. |
Binder |
selectBinder(Class controlType,
FormModel formModel,
String propertyName)
Returns a binder that is capable of binding the provided control type to the provided form model and property name. |
Binder |
selectBinder(FormModel formModel,
String propertyName)
Returns a binder for the provided form model and property name. |
void |
setApplicationContext(ApplicationContext applicationContext)
|
void |
setBinderForPropertyName(Properties binder)
Create/link a Binder to a propertyName from the given Properties . |
void |
setBindersForControlTypes(Map binders)
Registers control type binders by extracting the key and value from each entry in the provided map using the key to specify the property type and the value to specify the binder. |
void |
setBindersForPropertyNames(List binders)
Add a list of binders that are bound to propertyNames. |
void |
setBindersForPropertyTypes(Map binders)
Registers property type binders by extracting the key and value from each entry in the provided map using the key to specify the property type and the value to specify the binder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractBinderSelectionStrategy(Class defaultControlType)
Method Detail |
---|
public Binder selectBinder(FormModel formModel, String propertyName)
BinderSelectionStrategy
selectBinder
in interface BinderSelectionStrategy
formModel
- the form model which contains the property to be boundpropertyName
- the name of the property to be bound
Binder
(never null). This binder must be capable of
generating it's own control to bind to.public Binder selectBinder(Class controlType, FormModel formModel, String propertyName)
BinderSelectionStrategy
selectBinder
in interface BinderSelectionStrategy
controlType
- the type of the control to be boundformModel
- the form model which contains the property to be boundpropertyName
- the name of the property to be bound
Binder
(never null). This binder must be capable of
binding to a pre-created control that is of the specified controlType
.protected abstract void registerDefaultBinders()
registerBinderForPropertyName(Class, String, Binder)
,
registerBinderForPropertyType(Class, Binder)
,
registerBinderForControlType(Class, Binder)
protected Binder findBinderByPropertyName(Class parentObjectType, String propertyName)
protected Binder findBinderByPropertyType(Class propertyType)
protected Binder findBinderByControlType(Class controlType)
protected void registerBinderForPropertyName(Class parentObjectType, String propertyName, Binder binder)
public void setBindersForPropertyNames(List binders)
setBinderForPropertyName(Properties)
.
binders
- List of Properties
elementssetBinderForPropertyName(Properties)
public void setBinderForPropertyName(Properties binder)
Binder
to a propertyName from the given Properties
.
The used keys are:
Binder
.
Binder
which is defined elsewhere.
The first two keys are mandatory in combination with one of the two latter (binder or binderRef)
The following two cases can be used to define a binder/propertyName combination:
<props>
<prop key="objectClass">mypackage.MyBean</prop>
<prop key="propertyName">myProperty</prop>
<prop key="binder">mypackage.MyBinder</prop>
</props>
<props>
<prop key="objectClass">mypackage.MyBean</prop>
<prop key="propertyName">myProperty</prop>
<prop key="binderRef">myBinderBeanId</prop>
<!-- myBinderBeanId identifies a bean defined elsewhere-->
</props>
binder
- The Properties
object containing the correct keys.protected void registerBinderForPropertyType(Class propertyType, Binder binder)
public void setBindersForPropertyTypes(Map binders)
Binders specified in the provided map will override any binders previously registered for the same property type.
binders
- the map containing the entries to register; keys must be of type
Class
and values of type Binder
.protected void registerBinderForControlType(Class controlType, Binder binder)
public void setBindersForControlTypes(Map binders)
Binders specified in the provided map will override any binders previously registered for the same control type.
binders
- the map containing the entries to register; keys must be of type
Class
and values of type Binder
.protected Class getPropertyType(FormModel formModel, String formPropertyPath)
protected boolean isEnumeration(FormModel formModel, String formPropertyPath)
public void setApplicationContext(ApplicationContext applicationContext)
setApplicationContext
in interface ApplicationContextAware
protected ApplicationContext getApplicationContext()
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |