Class ControlSelectionVisitor
- All Implemented Interfaces:
ICatalogVisitor<IControlSelectionState,
Boolean>
Catalog
indexing all nodes that can be referenced.
For each CatalogGroup
, Control
, and ControlPart
,
determine if that object is IIndexer.SelectionStatus.SELECTED
or
IIndexer.SelectionStatus.UNSELECTED
.
A Control
is IIndexer.SelectionStatus.SELECTED
if it matches the
configured IControlFilter
, otherwise it is
IIndexer.SelectionStatus.UNSELECTED
.
A CatalogGroup
is IIndexer.SelectionStatus.SELECTED
if it contains a
IIndexer.SelectionStatus.SELECTED
descendant Control
, otherwise it is
IIndexer.SelectionStatus.UNSELECTED
.
A ControlPart
is IIndexer.SelectionStatus.SELECTED
if its containing
control is IIndexer.SelectionStatus.SELECTED
.
All other indexed nodes will have the IIndexer.SelectionStatus.UNKNOWN
, since
these nodes require reference counting to determine if they are to be kept or
not.
-
Field Summary
Fields inherited from class gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractCatalogEntityVisitor
CHILD_PART_METAPATH
-
Method Summary
Modifier and TypeMethodDescriptionprotected Boolean
aggregateResults
(Boolean first, Boolean second, IControlSelectionState state) protected IIndexer
getIndexer
(IControlSelectionState state) static ControlSelectionVisitor
instance()
protected Boolean
void
visit
(gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem catalogDocument, IControlSelectionState state) visitCatalog
(gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem catalogDocument, IControlSelectionState state) visitControl
(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem controlItem, Boolean childResult, IControlSelectionState state) Called when visiting a control.visitGroup
(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem groupItem, Boolean childSelected, IControlSelectionState state) Called when visiting a group.void
visitProfile
(gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem catalogDocument, gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem profileDocument, IControlSelectionState state) Methods inherited from class gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractIndexingVisitor
visitLocation, visitParameter, visitPart, visitParty, visitResource, visitRole
Methods inherited from class gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractCatalogEntityVisitor
getItemTypesToVisit, isVisitedItemType, visitBackMatter, visitControlContainer, visitControlInternal, visitGroupContainer, visitGroupInternal, visitMetadata, visitParts
Methods inherited from class gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractCatalogVisitor
visitControlItem, visitGroupItem
-
Method Details
-
instance
-
getIndexer
- Specified by:
getIndexer
in classAbstractIndexingVisitor<IControlSelectionState,
Boolean>
-
newDefaultResult
- Specified by:
newDefaultResult
in classAbstractCatalogVisitor<IControlSelectionState,
Boolean>
-
aggregateResults
- Specified by:
aggregateResults
in classAbstractCatalogVisitor<IControlSelectionState,
Boolean>
-
visit
public void visit(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem catalogDocument, @NonNull IControlSelectionState state) -
visitProfile
public void visitProfile(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem catalogDocument, @NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem profileDocument, @NonNull IControlSelectionState state) -
visitCatalog
public Boolean visitCatalog(gov.nist.secauto.metaschema.core.metapath.item.node.IDocumentNodeItem catalogDocument, IControlSelectionState state) - Overrides:
visitCatalog
in classAbstractCatalogEntityVisitor<IControlSelectionState,
Boolean>
-
visitGroup
public Boolean visitGroup(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem groupItem, Boolean childSelected, IControlSelectionState state) Description copied from interface:ICatalogVisitor
Called when visiting a group.Can be overridden by classes extending this interface to support processing of the visited object.
- Specified by:
visitGroup
in interfaceICatalogVisitor<IControlSelectionState,
Boolean> - Overrides:
visitGroup
in classAbstractIndexingVisitor<IControlSelectionState,
Boolean> - Parameters:
groupItem
- the Metapath item for the groupchildSelected
- the result of evaluating the group's childrenstate
- the calling context information- Returns:
- a meaningful result of the given type
-
visitControl
public Boolean visitControl(gov.nist.secauto.metaschema.core.metapath.item.node.IAssemblyNodeItem controlItem, Boolean childResult, IControlSelectionState state) Description copied from interface:ICatalogVisitor
Called when visiting a control.Can be overridden by classes extending this interface to support processing of the visited object.
- Specified by:
visitControl
in interfaceICatalogVisitor<IControlSelectionState,
Boolean> - Overrides:
visitControl
in classAbstractIndexingVisitor<IControlSelectionState,
Boolean> - Parameters:
controlItem
- the Metapath item for the controlchildResult
- the result of evaluating the control's childrenstate
- the calling context information- Returns:
- a meaningful result of the given type
-