Interface DocsBinder

All Superinterfaces:
Iterable<DocsNameSpace>
All Known Implementing Classes:
Docs

public interface DocsBinder extends Iterable<DocsNameSpace>
DocsInfo is a manifest view of a set of namespaces and included paths. The namespaces act as content slots to allow content to be managed by different layers of artifacts. For example, a downstream artifact can replace a context by replacing the same-named namespace.

 docsinfo = {
   'namespaces': [
     {
         'namespace': 'example-namespace-1',
         'paths': ['path1','path2']
     },
     {
         'namespace': 'example-namespace-2',
         'paths': ['path-foo','other-path']
     }
   ]
 }
 
Internally, The namespace entries are represented by DocsNameSpace types.
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     
    The result of merging two DocsInfo elements together is a combined DocsInfo element with all unique namespaces occurring exactly once, and with the other namespace overwriting same-named namespaces in the original element.
    The result of merging a DocPathInfo entry into a DocsInfo element is the combined DocsInfo element with the added entry overwriting any namespace of the same name.
    remove(Set<String> namespaces)
    The result of removing a set of namespaces from a DocsInfo element is a new DocsInfo element containing only the namespaces which were removed.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • merge

      DocsBinder merge(DocsBinder other)
      The result of merging two DocsInfo elements together is a combined DocsInfo element with all unique namespaces occurring exactly once, and with the other namespace overwriting same-named namespaces in the original element.
      Parameters:
      other - The DocsInfo containing namespaces to overlay into this DocsInfo
      Returns:
    • merge

      DocsBinder merge(DocsNameSpace other)
      The result of merging a DocPathInfo entry into a DocsInfo element is the combined DocsInfo element with the added entry overwriting any namespace of the same name.
      Parameters:
      other - The namespace entry to overlay into this DocsInfo
      Returns:
    • remove

      DocsBinder remove(Set<String> namespaces)
      The result of removing a set of namespaces from a DocsInfo element is a new DocsInfo element containing only the namespaces which were removed. The original DocsInfo element is modified statefully in this case. It is not an error to remove namespaces which are not present in the original DocsInfo. If this condition is important, check for it manually.
      Parameters:
      namespaces - The names of the namespaces to remove, should they be present.
      Returns:
      A new DocsInfo object representing what was actually removed.
    • getPaths

      List<Path> getPaths()
      Returns:
      All paths in all namespaces are returned, in no guaranteed order.
    • getPathMap

      Map<String,Set<Path>> getPathMap()
      Returns:
      A map of all namespaces to each set of provided paths is returned.
    • getNamespaces

      List<DocsNameSpace> getNamespaces()