Class TreeAccessorXItem

java.lang.Object
de.xima.fc.form.common.graph.TreeAccessorXItem
All Implemented Interfaces:
de.xima.cmn.graph.ITreeAccessor<XItem,String>

public final class TreeAccessorXItem extends Object implements de.xima.cmn.graph.ITreeAccessor<XItem,String>
A ITreeAccessor for XItem that accesses the children of an item. The hierarchy is specified by an item's parent ID. The ID is AXItemPropertiesData.getId().
  • Method Details

    • getChildren

      public List<XItem> getChildren(XItem xItem)
      Specified by:
      getChildren in interface de.xima.cmn.graph.ITreeAccessor<XItem,String>
    • getId

      public String getId(XItem xItem)
      Specified by:
      getId in interface de.xima.cmn.graph.ITreeAccessor<XItem,String>
    • ofChildMap

      public static de.xima.cmn.graph.ITreeAccessor<XItem,String> ofChildMap(Map<String, ? extends List<XItem>> childMap)
      Creates a new tree accessor for XItems using the given precomputed child map.
      Parameters:
      childMap - A map from the ID of an item to its children.
      Returns:
      A tree accessor for XItems.
    • ofXForm

      public static de.xima.cmn.graph.ITreeAccessor<XItem,String> ofXForm(IXForm xForm)
      Creates a new tree accessor for the XItems of the given form.
      Parameters:
      xForm - A form with XItems.
      Returns:
      A tree accessor for XItems.
    • ofXItems

      public static de.xima.cmn.graph.ITreeAccessor<XItem,String> ofXItems(Iterable<XItem> xItems)
      Creates a new tree accessor for the given XItems.
      Parameters:
      xItems - A list of items that form a hierarchy.
      Returns:
      A tree accessor for XItems.