|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.echo2.binding.Updater<V,M>
com.sptci.echo2.binding.ModelUpdater<V,M>
V - The class name of the view component from which data is read.M - The class name of the model object that is to be updated.public class ModelUpdater<V,M>
An updater used to update JavaBean objects from
their associated UI containers.
Copyright 2006 Sans Pareil Technologies, Inc.
| Field Summary |
|---|
| Fields inherited from class com.sptci.echo2.binding.Updater |
|---|
bean, logger, view |
| Constructor Summary | |
|---|---|
ModelUpdater(V view,
M bean)
Create a new instance with the specified UI container and java bean. |
|
| Method Summary | |
|---|---|
protected String |
getFieldName(String name)
Fetch the proper bean beanField name to use based upon the view beanField name. |
protected void |
processCollection(Map.Entry<String,Object> entry,
Method method,
String fieldName)
Process collection fields in Updater.bean. |
void |
update()
Update the fields of the Updater.bean with the data in
similarly named fields in Updater.view. |
protected void |
updateField(String fieldName,
Map.Entry<String,Object> entry)
Update the corresponding beanField in the Updater.bean with the specified
beanField name. |
| Methods inherited from class com.sptci.echo2.binding.Updater |
|---|
beanValues, getBean, getView, setBean, setView, viewValues |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ModelUpdater(V view,
M bean)
view - The Updater.view to use.bean - The Updater.bean to use.| Method Detail |
|---|
public void update()
Updater.bean with the data in
similarly named fields in Updater.view.
update in class Updater<V,M>BindingException - If errors are encountered while
accessing or setting the fields.ReflectionUtility.fetchField(java.lang.String, java.lang.Object),
ReflectionUtility.fetchMethod(java.lang.reflect.Field, java.lang.String, java.lang.Class...)protected String getFieldName(String name)
name - The view beanField name.
protected void updateField(String fieldName,
Map.Entry<String,Object> entry)
throws IntrospectionException
Updater.bean with the specified
beanField name.
fieldName - The name of the beanField in Updater.bean to update.entry - The map entry with the name and value of the associated
beanField in Updater.bean.
IntrospectionException - If reflection errors occur.
protected void processCollection(Map.Entry<String,Object> entry,
Method method,
String fieldName)
Updater.bean. Collections are usually
represented by AbstractListComponent
instances.
entry - A map entry representing the name of the field in Updater.view and its value.method - The method that is to be invoked on Updater.bean.fieldName - The name of the field in Updater.bean that is being
updated.
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||