Class AbstractCatalogVisitor<T,​R>

  • Type Parameters:
    T - the type of the state object used to pass calling context information
    R - the type of the result for visiting a collection of groups and/or controls
    All Implemented Interfaces:
    ICatalogVisitor<T,​R>
    Direct Known Subclasses:
    AbstractCatalogEntityVisitor

    public abstract class AbstractCatalogVisitor<T,​R>
    extends Object
    implements ICatalogVisitor<T,​R>
    Used to visit a catalog containing groups and controls.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract R aggregateResults​(R first, R second, T state)  
      protected abstract R newDefaultResult​(T state)  
      protected R visitCatalog​(gov.nist.secauto.metaschema.model.common.metapath.item.IDocumentNodeItem catalogDocument, T state)  
      protected R visitControlContainer​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem catalogOrGroupOrControl, R initialResult, T state)
      Visit the child controls (in that order) of a given catalog, group, or control container.
      protected R visitControlInternal​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem controlItem, R childResult, T state)
      Called when visiting a control after visiting it's children.
      protected R visitControlItem​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item, T state)
      Called when visiting a control.
      protected R visitGroupContainer​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem catalogOrGroup, R initialResult, T state)
      Visit the child groups and controls (in that order) of a given catalog or group container.
      protected R visitGroupInternal​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item, R childResult, T state)
      Called when visiting a group after visiting it's children.
      protected R visitGroupItem​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item, T state)
      Called when visiting a group.
    • Method Detail

      • visitCatalog

        protected R visitCatalog​(@NonNull
                                 gov.nist.secauto.metaschema.model.common.metapath.item.IDocumentNodeItem catalogDocument,
                                 T state)
      • visitGroupContainer

        protected R visitGroupContainer​(@NonNull
                                        gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem catalogOrGroup,
                                        R initialResult,
                                        T state)
        Visit the child groups and controls (in that order) of a given catalog or group container.
        Parameters:
        catalogOrGroup - the catalog or group Metapath item currently being visited
        initialResult - the initial result value to use when aggregating child results
        state - the current visitor state
        Returns:
        a meaningful result of the given type
      • visitGroupItem

        protected R visitGroupItem​(@NonNull
                                   gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item,
                                   T state)
        Called when visiting a group.

        This method will first visit the group's children, then the group itself.

        Parameters:
        item - the group Metapath item to visit
        state - the current visitor state
        Returns:
        a meaningful result of the given type
      • visitGroupInternal

        protected R visitGroupInternal​(@NonNull
                                       gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item,
                                       R childResult,
                                       T state)
        Called when visiting a group after visiting it's children.
        Parameters:
        item - the group Metapath item currently being visited
        childResult - the result of visiting the group's children
        state - the current visitor state
        Returns:
        a meaningful result of the given type
      • visitControlContainer

        protected R visitControlContainer​(@NonNull
                                          gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem catalogOrGroupOrControl,
                                          R initialResult,
                                          T state)
        Visit the child controls (in that order) of a given catalog, group, or control container.
        Parameters:
        catalogOrGroupOrControl - the catalog, group, or control Metapath item currently being visited
        initialResult - the initial result value to use when aggregating child results
        state - the current visitor state
        Returns:
        a meaningful result of the given type
      • visitControlItem

        protected R visitControlItem​(@NonNull
                                     gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item,
                                     T state)
        Called when visiting a control.

        This method will first visit the control's children, then the control itself.

        Parameters:
        item - the group Metapath item to visit
        state - the current visitor state
        Returns:
        a meaningful result of the given type
      • visitControlInternal

        protected R visitControlInternal​(@NonNull
                                         gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem controlItem,
                                         R childResult,
                                         T state)
        Called when visiting a control after visiting it's children.
        Parameters:
        controlItem - the Metapath item for the control currently being visited
        childResult - the result of visiting the control's children
        state - the calling context information
        Returns:
        a meaningful result of the given type