Interface IPathSegment

All Superinterfaces:
IMetapathQueryable
All Known Subinterfaces:
IAssemblyInstanceGroupedNodeItem, IAssemblyNodeItem, IAtomicValuedNodeItem, ICycledAssemblyNodeItem, IDefinitionNodeItem<D,I>, IDocumentBasedNodeItem, IDocumentNodeItem, IFeatureChildNodeItem, IFeatureFlagContainerItem, IFeatureModelContainerItem, IFeatureOrhpanedDefinitionNodeItem<D,I>, IFieldNodeItem, IFlagNodeItem, IModelNodeItem<D,I>, IModuleNodeItem, INodeItem, IRootAssemblyNodeItem
All Known Implementing Classes:
AbstractDefinitionNodeItem, AbstractFlagInstanceNodeItem, AbstractGlobalDefinitionNodeItem, AbstractInstanceNodeItem, AbstractNodeItem, AbstractOrphanedDefinitionNodeItem

public interface IPathSegment extends IMetapathQueryable
A named segment of a path that can be formatted.
  • Method Details

    • toPath

      @NonNull default String toPath(@NonNull IPathFormatter formatter)
      Get the path for this node item using the provided formatter.
      Parameters:
      formatter - the path formatter to use to produce the path
      Returns:
      the formatted path
    • format

      @NonNull String format(@NonNull IPathFormatter formatter)
      Apply formatting for the path segment. This is a visitor pattern that will be called to format each segment in a larger path.
      Parameters:
      formatter - the path formatter
      Returns:
      a textual representation of the path segment
    • getPath

      @NonNull default List<IPathSegment> getPath()
      Get a list of path segments, starting at the root and descending.
      Returns:
      a list of path segments in descending order
    • getPathStream

      @NonNull Stream<? extends IPathSegment> getPathStream()
      Get a stream of path segments, starting at the root and descending.
      Returns:
      a stream of path segments in descending order
    • getNodeItem

      INodeItem getNodeItem()
      Get the value associated with the path segment.
      Specified by:
      getNodeItem in interface IMetapathQueryable
      Returns:
      the value or null if no value is associated with this path segment