|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.richclient.command.CommandGroupModelBuilder
public abstract class CommandGroupModelBuilder
CommandGroupModelBuilder is a helper class that allows to build Object Models derived from ready command-group structures. These command-group structures are tree-like structures that this class will traverse. Actual building of specific matching object models (often also trees) is done through callbacks to specific buildXXXModel methods. (which are abstract on this generic traversing base-class) Actual use assumes one sublasses and implements those required abstract methods. Internally this class will traverse the commandGroup-structure and offer subclasses the opportunity to build up his matching model matching the command-group nesting by calling the various buildXXXModel methods.
Constructor Summary | |
---|---|
CommandGroupModelBuilder()
|
Method Summary | |
---|---|
protected abstract Object |
buildChildModel(Object parentModel,
AbstractCommand command,
int level)
Allows the implementation subclass to build a mapping object-model corresponding to a visited leaf node in the command-group structure. |
protected abstract Object |
buildGroupModel(Object parentModel,
CommandGroup commandGroup,
int level)
Allows the implementation subclass to build a mapping object-model corresponding to a visited non-leaf node in the command-group structure. |
Object |
buildModel(CommandGroup commandGroup)
Main service method of this method to call. |
protected abstract Object |
buildRootModel(CommandGroup commandGroup)
Builds the real root object that will be returned from buildModel(CommandGroup) . |
protected boolean |
continueDeeper(CommandGroup commandGroup,
int level)
Allows the implementation subclass to decide (by overriding) if traversing the structure should continue deeper down. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandGroupModelBuilder()
Method Detail |
---|
protected abstract Object buildRootModel(CommandGroup commandGroup)
buildModel(CommandGroup)
.
commandGroup
- at the root of the structure
protected boolean continueDeeper(CommandGroup commandGroup, int level)
commandGroup
- currently visited.level
- in the structure we are at ATM
true
if children of the group should be visted,
false
if not.protected abstract Object buildChildModel(Object parentModel, AbstractCommand command, int level)
version is called)
Since the parentModel is also passed in, the implementation can use it to
downcast that and possibly hook up the new client-structure.
parentModel
- the objectmodel that was created for the parent-command.command
- currently visited command in the structure.level
- in the structure we are at ATM
protected abstract Object buildGroupModel(Object parentModel, CommandGroup commandGroup, int level)
version is called)
Since the parentModel is also passed in, this implementation can use it
to downcast and decide to hook up the new client-structure.
In a same manner the object-structure returned by this method will be
passed down in the tree as the parentModel for nested nodes.
In general, if an implementation subclass is not building extra stuff for
a particular command at a particular level, then it is generally wise to
just pass down the parentModel.
parentModel
- the objectmodel that was created for the parent-command.command
- currently visited command in the structure.level
- in the structure we are at ATM
public final Object buildModel(CommandGroup commandGroup)
buildRootModel(CommandGroup)
,
buildChildModel(Object, AbstractCommand, int)
, and
buildGroupModel(Object, CommandGroup, int)
.
Additionally,
commandGroup
- the root of the structure for which an mapping objectmodel
will be built.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |