V - The class name of the view component.M - The class name of the model component.public abstract class Updater<V,M> extends Object
updater used to update UI containers or
JavaBean objects from one another.
Copyright 2006 Sans Pareil Technologies, Inc.
| Modifier and Type | Field and Description |
|---|---|
protected M |
bean
The java bean that contains the data to use to update the
view. |
protected static Logger |
logger
The logger used to log errors/warnings to.
|
protected V |
view
The UI container that is to be updated.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Updater()
Default constructor.
|
protected |
Updater(V view,
M bean)
Create a new instance with the specified UI container and java
bean.
|
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,Object> |
beanValues()
Fetch the values of all the fields in
bean that have
an accessor method conforming to JavaBean naming
convention. |
M |
getBean()
Returns
bean. |
V |
getView()
Returns
view. |
void |
setBean(M bean)
Set
bean. |
void |
setView(V view)
Set
view. |
abstract void |
update()
Update the fields of the desired component with the data contained
in similarly named fields in the other component.
|
protected Map<String,Object> |
viewValues()
Fetch the values of all the fields in
view. |
protected static final Logger logger
protected V view
protected Map<String,Object> beanValues() throws IllegalAccessException, InvocationTargetException, IntrospectionException
bean that have
an accessor method conforming to JavaBean naming
convention.key and
the field value as value.IllegalAccessException - If a custom security policy
restricts access to the bean fields.InvocationTargetException - If the accessor method for
the field could not be invoked successfully.IntrospectionException - If errors are encountered while
introspecing the bean for accessors.ReflectionUtility.fetchFields(java.lang.Object),
ReflectionUtility.fetchMethod( Object, String, Class[] )protected Map<String,Object> viewValues() throws IllegalAccessException, InvocationTargetException
view.
Convert the values of the UI components to the mapping scheme
used in bean generation.key and
the field value as value.IllegalAccessException - If a custom security policy
restricts access to the bean fields.InvocationTargetException - If the accessor method for
the field could not be invoked successfully.Utility.getViewValue(java.lang.Object),
ReflectionUtility.fetchFields(java.lang.Object),
ReflectionUtility.fetchMethod( Object, String, Class[] )public abstract void update()