public class BoundChildrenNode extends DefaultNode
INode
implementation that wraps an arbitrary java object,
creating a tree structure defined by a set of arbitrary children bindings.
If the object has children, one of the configured children
binding expressions should resolve to the List
or Object
[] (array) of the object's children.
This node must be initialized with the java object to wrap,
a row variable (used in binding expressions to indicate the current node),
a row id binding (a value-binding which evaluates to the unique id of the current node),
and a children binding (a value-binding which evaluates to the list
or array of children for the current node). Unless this node
is a root node, it must also be initialized with its direct parent INode
.
Modifier and Type | Class and Description |
---|---|
static class |
BoundChildrenNode.PermissiveContentProviderWrapper
Eats
PropertyNotFoundException s raised by standard content-providers. |
Modifier and Type | Field and Description |
---|---|
protected List |
m_childrenBinding |
protected ValueBinding |
m_idBinding |
protected String |
m_var |
m_children, m_data, m_id, m_parent
Constructor and Description |
---|
BoundChildrenNode()
New uninitialized node.
|
BoundChildrenNode(Object data)
New node, partially initialized with a java object to wrap.
|
BoundChildrenNode(Object data,
String dataVariable,
String idBinding,
String childrenBinding)
New node, initialized with a java object to wrap,
a row variable (used in binding expressions to indicate the current node),
a row id binding (a value-binding which evaluates to the unique id of the current node),
and a children binding (a value-binding which evaluates to the list
or array of children for the current node).
|
BoundChildrenNode(Object data,
String dataVariable,
ValueBinding idBinding,
List childrenBinding)
New node, initialized with a java object to wrap,
a row variable (used in binding expressions to indicate the current node),
a row id binding (a value-binding which evaluates to the unique id of the current node),
and a children binding (a value-binding which evaluates to the list
or array of children for the current node).
|
BoundChildrenNode(Object data,
String dataVariable,
ValueBinding idBinding,
List childrenBinding,
INode parent)
New node, initialized with a java object to wrap,
a row variable (used in binding expressions to indicate the current node),
a row id binding (a value-binding which evaluates to the unique id of the current node),
a children binding (a value-binding which evaluates to the list
or array of children for the current node), and its direct parent
INode . |
Modifier and Type | Method and Description |
---|---|
List |
getChildren()
List of
INode children, in order. |
List |
getChildrenBinding() |
String |
getDataVariable() |
String |
getId()
Row id.
|
ValueBinding |
getIdBinding() |
void |
setChildrenBinding(List binding)
Set children binding list.
|
void |
setChildrenBinding(String binding)
Set children binding list.
|
void |
setData(Object data)
Set node data.
|
void |
setDataVariable(String var)
Set data variable name.
|
void |
setIdBinding(String binding)
Construct a binding using the binding string and set as ID binding.
|
void |
setIdBinding(ValueBinding binding)
Set ID binding.
|
addChild, getData, getParent, removeChild, setChildren, setId, setParent
protected String m_var
protected ValueBinding m_idBinding
protected List m_childrenBinding
public BoundChildrenNode()
INode
.public BoundChildrenNode(Object data)
INode
.public BoundChildrenNode(Object data, String dataVariable, String idBinding, String childrenBinding)
INode
.public BoundChildrenNode(Object data, String dataVariable, ValueBinding idBinding, List childrenBinding)
INode
.public BoundChildrenNode(Object data, String dataVariable, ValueBinding idBinding, List childrenBinding, INode parent)
INode
.public String getId()
INode
getId
in interface INode
getId
in class DefaultNode
public List getChildren()
INode
INode
children, in order.
Empty list (non-null) for leaf nodes.getChildren
in interface INode
getChildren
in class DefaultNode
public void setData(Object data)
DefaultNode
setData
in class DefaultNode
public String getDataVariable()
public void setDataVariable(String var)
var
- public ValueBinding getIdBinding()
public void setIdBinding(ValueBinding binding)
binding
- public void setIdBinding(String binding)
binding
- public List getChildrenBinding()
public void setChildrenBinding(List binding)
binding
- public void setChildrenBinding(String binding)
ListTools.stringToList(String)
and the children bindings are constructed based on the list.binding
-