Class TreeBuilder
java.lang.Object
com.webmethods.caf.faces.data.tree.object.TreeBuilder
Helper class for building trees.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildFromChildIds
(List<?> rows, String rowVariable, ValueExpression rowIdBinding, ValueExpression childIdsBinding) Build a tree out a list of rows, where the tree structure is determined by child-ids bindings (ie each row contains a field with the ids of its children).buildFromChildIds
(List<?> rows, String rowVariable, ValueBinding rowIdBinding, ValueBinding childIdsBinding) Deprecated.buildFromParentIds
(List<?> rows, String rowVariable, ValueExpression rowIdBinding, ValueExpression parentIdBinding) Build a tree out a list of rows, where the tree structure is determined by parent-id bindings (ie each row contains a field with the id of its parent).buildFromParentIds
(List<?> rows, String rowVariable, ValueBinding rowIdBinding, ValueBinding parentIdBinding) Deprecated.
-
Constructor Details
-
TreeBuilder
public TreeBuilder()
-
-
Method Details
-
buildFromParentIds
@Deprecated public static List<INode> buildFromParentIds(List<?> rows, String rowVariable, ValueBinding rowIdBinding, ValueBinding parentIdBinding) Deprecated.Build a tree out a list of rows, where the tree structure is determined by parent-id bindings (ie each row contains a field with the id of its parent).- Type Parameters:
T
-- Parameters:
rows
- List of rows. This may be empty, but not null.rowVariable
- Row variable used in row-id and parent-id bindings. For example, if the row-id binding is #{row.id}, the row variable is "row".rowIdBinding
- Binding expression that calculates the row-id for the current row. This must return a unique string id for each row.parentIdBinding
- Binding expression that calculates the parent-id for the current row. This must return null for rows that represent roots, and a valid parent row-id for all other rows.- Returns:
- List of
INode
roots of the tree. Never null; may be empty if original list of rows was empty.
-
buildFromParentIds
public static List<INode> buildFromParentIds(List<?> rows, String rowVariable, ValueExpression rowIdBinding, ValueExpression parentIdBinding) Build a tree out a list of rows, where the tree structure is determined by parent-id bindings (ie each row contains a field with the id of its parent).- Type Parameters:
T
-- Parameters:
rows
- List of rows. This may be empty, but not null.rowVariable
- Row variable used in row-id and parent-id bindings. For example, if the row-id binding is #{row.id}, the row variable is "row".rowIdBinding
- Binding expression that calculates the row-id for the current row. This must return a unique string id for each row.parentIdBinding
- Binding expression that calculates the parent-id for the current row. This must return null for rows that represent roots, and a valid parent row-id for all other rows.- Returns:
- List of
INode
roots of the tree. Never null; may be empty if original list of rows was empty.
-
buildFromChildIds
@Deprecated public static List<INode> buildFromChildIds(List<?> rows, String rowVariable, ValueBinding rowIdBinding, ValueBinding childIdsBinding) Deprecated.Build a tree out a list of rows, where the tree structure is determined by child-ids bindings (ie each row contains a field with the ids of its children).- Type Parameters:
T
-- Parameters:
rows
- List of rows. This may be empty, but not null.rowVariable
- Row variable used in row-id and child-ids bindings. For example, if the row-id binding is #{row.id}, the row variable is "row".rowIdBinding
- Binding expression that calculates the row-id for the current row. This must return a unique string id for each row.childIdsBinding
- Binding expression that calculates the child-ids for the current row. This must return a comma-separatedString
of row-ids, aCollection
of row-ids, an array ofString
row-ids, or null. It may return an empty string, collection, or array.- Returns:
- List of
INode
roots of the tree. Never null; may be empty if original list of rows was empty.
-
buildFromChildIds
public static List<INode> buildFromChildIds(List<?> rows, String rowVariable, ValueExpression rowIdBinding, ValueExpression childIdsBinding) Build a tree out a list of rows, where the tree structure is determined by child-ids bindings (ie each row contains a field with the ids of its children).- Type Parameters:
T
-- Parameters:
rows
- List of rows. This may be empty, but not null.rowVariable
- Row variable used in row-id and child-ids bindings. For example, if the row-id binding is #{row.id}, the row variable is "row".rowIdBinding
- Binding expression that calculates the row-id for the current row. This must return a unique string id for each row.childIdsBinding
- Binding expression that calculates the child-ids for the current row. This must return a comma-separatedString
of row-ids, aCollection
of row-ids, an array ofString
row-ids, or null. It may return an empty string, collection, or array.- Returns:
- List of
INode
roots of the tree. Never null; may be empty if original list of rows was empty.
-
buildFromChildIds(List, String, ValueExpression, ValueExpression)
instead