Class TreeBuilder

java.lang.Object
com.webmethods.caf.faces.data.tree.object.TreeBuilder

public class TreeBuilder extends Object
Helper class for building trees.
  • Constructor Details

    • TreeBuilder

      public TreeBuilder()
  • Method Details

    • buildFromParentIds

      @Deprecated public static List<INode> buildFromParentIds(List<?> rows, String rowVariable, ValueBinding rowIdBinding, ValueBinding 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.
    • 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)
      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-separated String of row-ids, a Collection of row-ids, an array of String 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-separated String of row-ids, a Collection of row-ids, an array of String 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.