Class AbstractCatalogVisitor<T,R>

java.lang.Object
gov.nist.secauto.oscal.lib.profile.resolver.support.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.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract R
    aggregateResults(R first, R second, T state)
     
    protected abstract R
     
    protected R
    visitCatalog(gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem catalogDocument, T state)
     
    protected R
    visitControlContainer(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem 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.core.metapath.item.node.IAssemblyNodeItem control, R childResult, T state)
    Called when visiting a control after visiting it's children.
    protected R
    visitControlItem(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem control, T state)
    Called when visiting a control.
    protected R
    visitGroupContainer(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem 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.core.metapath.item.node.IAssemblyNodeItem group, R childResult, T state)
    Called when visiting a group after visiting it's children.
    protected R
    visitGroupItem(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem group, T state)
    Called when visiting a group.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface gov.nist.secauto.oscal.lib.profile.resolver.support.ICatalogVisitor

    visitControl, visitGroup
  • Constructor Details

  • Method Details

    • newDefaultResult

      protected abstract R newDefaultResult(T state)
    • aggregateResults

      protected abstract R aggregateResults(R first, R second, T state)
    • visitCatalog

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

      protected R visitGroupContainer(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem 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.core.metapath.item.node.IAssemblyNodeItem group, T state)
      Called when visiting a group.

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

      Parameters:
      group - 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.core.metapath.item.node.IAssemblyNodeItem group, R childResult, T state)
      Called when visiting a group after visiting it's children.
      Parameters:
      group - 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.core.metapath.item.node.IAssemblyNodeItem 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.core.metapath.item.node.IAssemblyNodeItem control, T state)
      Called when visiting a control.

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

      Parameters:
      control - the control 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.core.metapath.item.node.IAssemblyNodeItem control, R childResult, T state)
      Called when visiting a control after visiting it's children.
      Parameters:
      control - 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