T - public abstract class CommonNodeFactory<T extends CommonNode> extends Object
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.
| Modifier and Type | Method and Description |
|---|---|
abstract T |
createNode(CommonNode parent,
Object object) |
CommonNodeFactory<?> |
lookupFactory(Object object) |
CommonNode |
lookupNode(CommonNode parent,
Object object) |
void |
registerFactory(Class<?> clazz,
CommonNodeFactory<?> factory) |
void |
registerNode(CommonNode parent,
CommonNode node) |
public abstract T createNode(CommonNode parent, Object object)
public CommonNodeFactory<?> lookupFactory(Object object)
public CommonNode lookupNode(CommonNode parent, Object object)
public void registerFactory(Class<?> clazz, CommonNodeFactory<?> factory)
public void registerNode(CommonNode parent, CommonNode node)
Copyright © 2013 intarsys consulting GmbH. All Rights Reserved.