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 informationR
- 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 AbstractCatalogVisitor()
-
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.-
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 Detail
-
AbstractCatalogVisitor
public AbstractCatalogVisitor()
-
-
Method Detail
-
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.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 visitedinitialResult
- the initial result value to use when aggregating child resultsstate
- 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 visitstate
- 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 visitedchildResult
- the result of visiting the group's childrenstate
- 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 visitedinitialResult
- the initial result value to use when aggregating child resultsstate
- 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 visitstate
- 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 visitedchildResult
- the result of visiting the control's childrenstate
- the calling context information- Returns:
- a meaningful result of the given type
-
-