de.intarsys.tools.tree.CommonNodeFactory Maven / Gradle / Ivy
Show all versions of isrt Show documentation
package de.intarsys.tools.tree;
import java.util.HashMap;
import java.util.Map;
import java.util.WeakHashMap;
import de.intarsys.tools.attribute.Attribute;
/**
* The common implementation of a {@link 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.
*
* @param
*/
abstract public class CommonNodeFactory {
private Map, CommonNodeFactory>> children;
final private Map