T - type of data used to create nodes (can be just a String type to use only ids)O - type of data associated with nodesN - type of node to used (to make possible full co-variance and no cast in fal implementations).public abstract class NavNodeChildLoador<T,O,M,B extends NavBridge<M,N>,N extends NavNode<M,N>> extends Object implements Serializable
NavDataProvider in method
loadChilds(NavBridge, NavNode, NavDataProvider) to obtain datas
then build childs nodes.
A factory of such objects can be found in NavHelper to make
them reusable in other places than inside a NavNode to auto-load
childs.
For example when you want to creat by hand a new node, always prefer to reuse
a such object rathen than duplicate same code in helper...NavHelper,
NavNode,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected Class<O> |
beanType
Type of data of the node
|
| Modifier | Constructor and Description |
|---|---|
protected |
NavNodeChildLoador(Class<O> beanType) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addChildNodes(N parentNode,
List<T> datas,
NavDataProvider dataProvider)
Add childs to given
parentNode using retrive datas from
the data provider. |
abstract N |
createNode(T data,
NavDataProvider dataProvider)
Hook to create a child node given his
data. |
Class<O> |
getBeanType()
Returns the type of data associated with nodes to create.
|
abstract List<T> |
getData(Class<?> parentClass,
String parentId,
NavDataProvider dataProvider)
Obtain the list of data used to create nodes.
|
void |
loadChilds(B bridge,
N parentNode,
NavDataProvider dataProvider)
Load childs of the given
parentnode. |
public abstract List<T> getData(Class<?> parentClass, String parentId, NavDataProvider dataProvider)
T is O, we directly use the data associated with nodes.parentClass - type of parentparentId - id of parentdataProvider - the data providerException - if any problempublic abstract N createNode(T data, NavDataProvider dataProvider)
data.data - the data of the node to createdataProvider - the data providerpublic Class<O> getBeanType()
public void loadChilds(B bridge, N parentNode, NavDataProvider dataProvider)
parentnode.bridge - the model owner of nodesparentNode - the parent node where to insert nodesdataProvider - data providerException - pour tout probleme de recuperation de donneesprotected void addChildNodes(N parentNode, List<T> datas, NavDataProvider dataProvider)
parentNode using retrive datas from
the data provider.
This method is invoked by the loadChilds(NavBridge, NavNode, NavDataProvider).parentNode - the node where to insertdatas - the data used to create nodedataProvider - the data providerCopyright © 2008–2020 Ultreia.io. All rights reserved.