Class ControlSelectionVisitor
- java.lang.Object
-
- gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractCatalogVisitor<T,R>
-
- gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractCatalogEntityVisitor<T,R>
-
- gov.nist.secauto.oscal.lib.profile.resolver.support.AbstractIndexingVisitor<IControlSelectionState,Boolean>
-
- gov.nist.secauto.oscal.lib.profile.resolver.selection.ControlSelectionVisitor
-
- All Implemented Interfaces:
ICatalogVisitor<IControlSelectionState,Boolean>
public class ControlSelectionVisitor extends AbstractIndexingVisitor<IControlSelectionState,Boolean>
Walks aCatalogindexing all nodes that can be referenced.For each
CatalogGroup,Control, andControlPart, determine if that object isIIndexer.SelectionStatus.SELECTEDorIIndexer.SelectionStatus.UNSELECTED.A
ControlisIIndexer.SelectionStatus.SELECTEDif it matches the configuredIControlFilter, otherwise it isIIndexer.SelectionStatus.UNSELECTED.A
CatalogGroupisIIndexer.SelectionStatus.SELECTEDif it contains aIIndexer.SelectionStatus.SELECTEDdescendantControl, otherwise it isIIndexer.SelectionStatus.UNSELECTED.A
ControlPartisIIndexer.SelectionStatus.SELECTEDif its containing control isIIndexer.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
-
-
Constructor Summary
Constructors Constructor Description ControlSelectionVisitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BooleanaggregateResults(Boolean first, Boolean second, IControlSelectionState state)protected IIndexergetIndexer(IControlSelectionState state)static ControlSelectionVisitorinstance()protected BooleannewDefaultResult(IControlSelectionState state)voidvisit(gov.nist.secauto.metaschema.model.common.metapath.item.IDocumentNodeItem catalogDocument, IControlSelectionState state)BooleanvisitCatalog(gov.nist.secauto.metaschema.model.common.metapath.item.IDocumentNodeItem catalogDocument, IControlSelectionState state)BooleanvisitControl(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem controlItem, Boolean childResult, IControlSelectionState state)Called when visiting a control.BooleanvisitGroup(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem groupItem, Boolean childSelected, IControlSelectionState state)Called when visiting a group.voidvisitProfile(gov.nist.secauto.metaschema.model.common.metapath.item.IDocumentNodeItem catalogDocument, gov.nist.secauto.metaschema.model.common.metapath.item.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
-
-
-
-
Constructor Detail
-
ControlSelectionVisitor
public ControlSelectionVisitor()
-
-
Method Detail
-
instance
public static ControlSelectionVisitor instance()
-
getIndexer
protected IIndexer getIndexer(IControlSelectionState state)
- Specified by:
getIndexerin classAbstractIndexingVisitor<IControlSelectionState,Boolean>
-
newDefaultResult
protected Boolean newDefaultResult(IControlSelectionState state)
- Specified by:
newDefaultResultin classAbstractCatalogVisitor<IControlSelectionState,Boolean>
-
aggregateResults
protected Boolean aggregateResults(Boolean first, Boolean second, IControlSelectionState state)
- Specified by:
aggregateResultsin classAbstractCatalogVisitor<IControlSelectionState,Boolean>
-
visit
public void visit(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IDocumentNodeItem catalogDocument, @NonNull IControlSelectionState state)
-
visitProfile
public void visitProfile(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IDocumentNodeItem catalogDocument, @NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IDocumentNodeItem profileDocument, @NonNull IControlSelectionState state)
-
visitCatalog
public Boolean visitCatalog(gov.nist.secauto.metaschema.model.common.metapath.item.IDocumentNodeItem catalogDocument, IControlSelectionState state)
- Overrides:
visitCatalogin classAbstractCatalogEntityVisitor<IControlSelectionState,Boolean>
-
visitGroup
public Boolean visitGroup(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem groupItem, Boolean childSelected, IControlSelectionState state)
Description copied from interface:ICatalogVisitorCalled when visiting a group.Can be overridden by classes extending this interface to support processing of the visited object.
- Specified by:
visitGroupin interfaceICatalogVisitor<IControlSelectionState,Boolean>- Overrides:
visitGroupin 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.model.common.metapath.item.IRequiredValueModelNodeItem controlItem, Boolean childResult, IControlSelectionState state)
Description copied from interface:ICatalogVisitorCalled when visiting a control.Can be overridden by classes extending this interface to support processing of the visited object.
- Specified by:
visitControlin interfaceICatalogVisitor<IControlSelectionState,Boolean>- Overrides:
visitControlin 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
-
-