|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.joda.property.JodaUtils
JodaUtils groups together useful routines for handling Joda object models
Method Summary | |
static TreeNode |
createTreeNode(Bean bean)
Create a TreeNode tree for a bean. |
static void |
resolve(Bean staleBean,
Bean updatedBean)
Resolve an updated Bean into the local, stale, Bean. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void resolve(Bean staleBean, Bean updatedBean)
This routine is useful when complex state is held in the client with the server side performing updates. For example, client requests a list of people by surname. The surname returns a list of partially populated Person objects in a ClientSearch bean. The client then selects one of the Person objects in the list and calls the server asking for the full Person details. The Person object returned by the server needs to be reinserted back into the list in the ClientSearch object so that the client state is fully back in sync. This routine does that.
The resolution is based on Beans that implement Identifiable. All the identifiable beans from the updated bean are extracted. The stale bean is then searched for the same references, and the updated version is inserted instead.
The resolution mechanism works at an object level, so any local changes in the stale bean will be lost if a match is found in the updated bean.
staleBean
- the locally held bean, that is now staleupdatedBean
- the new updated bean to be inserted into the local onepublic static TreeNode createTreeNode(Bean bean)
Infinite recursion is blocked. If a bean occurs a second time, then it's children will not be added.
bean
- the bean to get the tree for
|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |