com.webmethods.caf.faces.data.tree.object
Class BoundChildrenNode

java.lang.Object
  extended by com.webmethods.caf.faces.data.tree.object.DefaultNode
      extended by com.webmethods.caf.faces.data.tree.object.BoundChildrenNode
All Implemented Interfaces:
INode, Serializable

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.

See Also:
Serialized Form

Nested Class Summary
static class BoundChildrenNode.PermissiveContentProviderWrapper
          Eats PropertyNotFoundExceptions raised by standard content-providers.
 
Field Summary
protected  List m_childrenBinding
           
protected  ValueBinding m_idBinding
           
protected  String m_var
           
 
Fields inherited from class com.webmethods.caf.faces.data.tree.object.DefaultNode
m_children, m_data, m_id, m_parent
 
Constructor Summary
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.
 
Method Summary
 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(ValueBinding binding)
          Set ID binding.
 
Methods inherited from class com.webmethods.caf.faces.data.tree.object.DefaultNode
addChild, getData, getParent, removeChild, setChildren, setId, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_var

protected String m_var

m_idBinding

protected ValueBinding m_idBinding

m_childrenBinding

protected List m_childrenBinding
Constructor Detail

BoundChildrenNode

public BoundChildrenNode()
New uninitialized node. 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.


BoundChildrenNode

public BoundChildrenNode(Object data)
New node, partially initialized with a java object to wrap. This node must be initialized additionally with 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.


BoundChildrenNode

public 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). Unless this node is a root node, it must also be initialized with its direct parent INode.


BoundChildrenNode

public 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). Unless this node is a root node, it must also be initialized with its direct parent INode.


BoundChildrenNode

public 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.

Method Detail

getId

public String getId()
Description copied from interface: INode
Row id.

Specified by:
getId in interface INode
Overrides:
getId in class DefaultNode

getChildren

public List getChildren()
Description copied from interface: INode
List of INode children, in order. Empty list (non-null) for leaf nodes.

Specified by:
getChildren in interface INode
Overrides:
getChildren in class DefaultNode

setData

public void setData(Object data)
Description copied from class: DefaultNode
Set node data.

Overrides:
setData in class DefaultNode

getDataVariable

public String getDataVariable()
Returns:
data variable name.

setDataVariable

public void setDataVariable(String var)
Set data variable name.

Parameters:
var -

getIdBinding

public ValueBinding getIdBinding()
Returns:
ID binding.

setIdBinding

public void setIdBinding(ValueBinding binding)
Set ID binding.

Parameters:
binding -

getChildrenBinding

public List getChildrenBinding()
Returns:
children binding list.

setChildrenBinding

public void setChildrenBinding(List binding)
Set children binding list.

Parameters:
binding -

setChildrenBinding

public void setChildrenBinding(String binding)
Set children binding list. The binding string will be converted to list using ListTools.stringToList(String) and the children bindings are constructed based on the list.

Parameters:
binding -