Class AbstractCatalogEntityVisitor<T,R>
- Type Parameters:
T
- the state typeR
- the result type
- All Implemented Interfaces:
ICatalogVisitor<T,
R>
- Direct Known Subclasses:
AbstractIndexingVisitor
,FilterNonSelectedVisitor
,FlatteningStructuringVisitor
,ReferenceCountingVisitor
This implementation is stateless. The T
parameter can be used to
convey state as needed.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final gov.nist.secauto.metaschema.core.metapath.MetapathExpression
-
Constructor Summary
ConstructorDescriptionAbstractCatalogEntityVisitor
(Set<IEntityItem.ItemType> itemTypesToVisit) Create a new visitor that will visit the item types identified byitemTypesToVisit
. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected void
visitBackMatter
(gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem rootItem, T state) Called when visiting the "back-matter" section of an OSCAL document.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 item, R childResult, T state) Called when visiting a control after visiting it's children.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 item, R childResult, T state) Called when visiting a group after visiting it's children.protected void
visitLocation
(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem item, gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem metadataItem, T state) Called when visiting a location in the "metadata" section of an OSCAL document.protected void
visitMetadata
(gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem rootItem, T state) Called when visiting the "metadata" section of an OSCAL document.protected R
visitParameter
(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem item, gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem catalogOrGroupOrControl, T state) Called when visiting a parameter.protected void
visitPart
(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem item, gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem groupOrControl, T state) Called when visiting a part.protected void
visitParts
(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem groupOrControlItem, T state) protected void
visitParty
(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem item, gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem metadataItem, T state) Called when visiting a party in the "metadata" section of an OSCAL document.protected void
visitResource
(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem resource, gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem backMatter, T state) Called when visiting a resource in the "back-matter" section of an OSCAL document.protected void
visitRole
(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem item, gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem metadataItem, T state) Called when visiting a role in the "metadata" section of an OSCAL document.Methods inherited from class gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractCatalogVisitor
aggregateResults, newDefaultResult, visitControlItem, visitGroupItem
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
-
Field Details
-
CHILD_PART_METAPATH
@NonNull public static final gov.nist.secauto.metaschema.core.metapath.MetapathExpression CHILD_PART_METAPATH
-
-
Constructor Details
-
AbstractCatalogEntityVisitor
Create a new visitor that will visit the item types identified byitemTypesToVisit
.- Parameters:
itemTypesToVisit
- the item type the visitor will visit
-
-
Method Details
-
getItemTypesToVisit
-
isVisitedItemType
-
visitCatalog
public R visitCatalog(gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem catalogDocument, T state) - Overrides:
visitCatalog
in classAbstractCatalogVisitor<T,
R>
-
visitGroupContainer
protected R visitGroupContainer(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem catalogOrGroup, R initialResult, T state) Description copied from class:AbstractCatalogVisitor
Visit the child groups and controls (in that order) of a given catalog or group container.- Overrides:
visitGroupContainer
in classAbstractCatalogVisitor<T,
R> - 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
-
visitControlContainer
protected R visitControlContainer(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem catalogOrGroupOrControl, R initialResult, T state) Description copied from class:AbstractCatalogVisitor
Visit the child controls (in that order) of a given catalog, group, or control container.- Overrides:
visitControlContainer
in classAbstractCatalogVisitor<T,
R> - 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
-
visitParts
protected void visitParts(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem groupOrControlItem, T state) -
visitGroupInternal
protected R visitGroupInternal(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem item, R childResult, T state) Description copied from class:AbstractCatalogVisitor
Called when visiting a group after visiting it's children.- Overrides:
visitGroupInternal
in classAbstractCatalogVisitor<T,
R> - 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
-
visitControlInternal
protected R visitControlInternal(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem item, R childResult, T state) Description copied from class:AbstractCatalogVisitor
Called when visiting a control after visiting it's children.- Overrides:
visitControlInternal
in classAbstractCatalogVisitor<T,
R> - Parameters:
item
- 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
-
visitParameter
protected R visitParameter(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem item, @NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem catalogOrGroupOrControl, T state) Called when visiting a parameter.Can be overridden by classes extending this interface to support processing of the visited object.
- Parameters:
item
- the Metapath item for the parametercatalogOrGroupOrControl
- the parameter's parent Metapath itemstate
- the calling context information- Returns:
- a meaningful result of the given type
-
visitPart
protected void visitPart(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem item, @NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem groupOrControl, T state) Called when visiting a part.Can be overridden by classes extending this interface to support processing of the visited object.
- Parameters:
item
- the Metapath item for the partgroupOrControl
- the part's parent Metapath itemstate
- the calling context information
-
visitMetadata
protected void visitMetadata(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem rootItem, T state) Called when visiting the "metadata" section of an OSCAL document.Visits each contained role, location, and party.
- Parameters:
rootItem
- the root Module node item containing the "metadata" nodestate
- the calling context information
-
visitRole
protected void visitRole(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem item, @NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem metadataItem, T state) Called when visiting a role in the "metadata" section of an OSCAL document.Can be overridden by classes extending this interface to support processing of the visited object.
- Parameters:
item
- the role Module node item which is a child of the "metadata" nodemetadataItem
- the "metadata" Module node item containing the rolestate
- the calling context information
-
visitLocation
protected void visitLocation(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem item, @NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem metadataItem, T state) Called when visiting a location in the "metadata" section of an OSCAL document.Can be overridden by classes extending this interface to support processing of the visited object.
- Parameters:
item
- the location Module node item which is a child of the "metadata" nodemetadataItem
- the "metadata" Module node item containing the locationstate
- the calling context information
-
visitParty
protected void visitParty(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem item, @NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem metadataItem, T state) Called when visiting a party in the "metadata" section of an OSCAL document.Can be overridden by classes extending this interface to support processing of the visited object.
- Parameters:
item
- the party Module node item which is a child of the "metadata" nodemetadataItem
- the "metadata" Module node item containing the partystate
- the calling context information
-
visitBackMatter
protected void visitBackMatter(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem rootItem, T state) Called when visiting the "back-matter" section of an OSCAL document.Visits each contained resource.
- Parameters:
rootItem
- the root Module node item containing the "back-matter" nodestate
- the calling context information
-
visitResource
protected void visitResource(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem resource, @NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IRootAssemblyNodeItem backMatter, T state) Called when visiting a resource in the "back-matter" section of an OSCAL document.Can be overridden by classes extending this interface to support processing of the visited object.
- Parameters:
resource
- the resource Module node item which is a child of the "metadata" nodebackMatter
- the resource Module node item containing the partystate
- the calling context information
-