de.intarsys.tools.tree
Class CommonNodeFactory<T extends CommonNode>
java.lang.Object
de.intarsys.tools.tree.CommonNodeFactory<T>
- Type Parameters:
T -
public abstract class CommonNodeFactory<T extends CommonNode>
- extends Object
The common implementation of a CommonNode factory.
This implementation ensures uniqueness of an object->node association within
the parent node. This means within a given parent context, the node returned
for a given object is always the same.
While all factories have their own way of creating a node based on the POJO,
they all share the ability to "fine tune" the node creation in a certain
context (role).
For fine tuning node creation, just register some other node factories using
"registerFactory". Upon creation of a node for this specific role, all
registered factories are searched if there is a more specific one for the
creation based on the objects's class.
createNode
public abstract T createNode(CommonNode parent,
Object object)
lookupFactory
public CommonNodeFactory<?> lookupFactory(Object object)
lookupNode
public CommonNode lookupNode(CommonNode parent,
Object object)
registerFactory
public void registerFactory(Class<?> clazz,
CommonNodeFactory<?> factory)
registerNode
public void registerNode(CommonNode parent,
CommonNode node)
Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.