Class AbstractCatalogEntityVisitor<T,​R>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static gov.nist.secauto.metaschema.model.common.metapath.MetapathExpression CHILD_PART_METAPATH  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Set<IEntityItem.ItemType> getItemTypesToVisit()  
      protected boolean isVisitedItemType​(IEntityItem.ItemType type)  
      protected void visitBackMatter​(gov.nist.secauto.metaschema.model.common.metapath.item.IRootAssemblyNodeItem rootItem, T state)
      Called when visiting the "back-matter" section of an OSCAL document.
      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 item, R childResult, T state)
      Called when visiting a control after visiting it's children.
      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 void visitLocation​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item, gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem metadataItem, T state)
      Called when visiting a location in the "metadata" section of an OSCAL document.
      protected void visitMetadata​(gov.nist.secauto.metaschema.model.common.metapath.item.IRootAssemblyNodeItem rootItem, T state)
      Called when visiting the "metadata" section of an OSCAL document.
      protected R visitParameter​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item, gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem catalogOrGroupOrControl, T state)
      Called when visiting a parameter.
      protected void visitPart​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item, gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem groupOrControl, T state)
      Called when visiting a part.
      protected void visitParts​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem groupOrControlItem, T state)  
      protected void visitParty​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item, gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem metadataItem, T state)
      Called when visiting a party in the "metadata" section of an OSCAL document.
      protected void visitResource​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item, gov.nist.secauto.metaschema.model.common.metapath.item.IRootAssemblyNodeItem backMatterItem, T state)
      Called when visiting a resource in the "back-matter" section of an OSCAL document.
      protected void visitRole​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item, gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem metadataItem, T state)
      Called when visiting a role in the "metadata" section of an OSCAL document.
    • Field Detail

      • CHILD_PART_METAPATH

        @NonNull
        public static final gov.nist.secauto.metaschema.model.common.metapath.MetapathExpression CHILD_PART_METAPATH
    • Constructor Detail

      • AbstractCatalogEntityVisitor

        public AbstractCatalogEntityVisitor​(@NonNull
                                            Set<IEntityItem.ItemType> itemTypesToVisit)
        Create a new visitor that will visit the item types identified by itemTypesToVisit.
        Parameters:
        itemTypesToVisit - the item type the visitor will visit
    • Method Detail

      • visitGroupContainer

        protected R visitGroupContainer​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem 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 class AbstractCatalogVisitor<T,​R>
        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
      • visitControlContainer

        protected R visitControlContainer​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem 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 class AbstractCatalogVisitor<T,​R>
        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
      • visitParts

        protected void visitParts​(@NonNull
                                  gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem groupOrControlItem,
                                  T state)
      • visitGroupInternal

        protected R visitGroupInternal​(@NonNull
                                       gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item,
                                       R childResult,
                                       T state)
        Description copied from class: AbstractCatalogVisitor
        Called when visiting a group after visiting it's children.
        Overrides:
        visitGroupInternal in class AbstractCatalogVisitor<T,​R>
        Parameters:
        item - 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
      • visitControlInternal

        protected R visitControlInternal​(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item,
                                         R childResult,
                                         T state)
        Description copied from class: AbstractCatalogVisitor
        Called when visiting a control after visiting it's children.
        Overrides:
        visitControlInternal in class AbstractCatalogVisitor<T,​R>
        Parameters:
        item - 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
      • visitParameter

        protected R visitParameter​(@NonNull
                                   gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item,
                                   @NonNull
                                   gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem 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 parameter
        catalogOrGroupOrControl - the parameter's parent Metapath item
        state - the calling context information
        Returns:
        a meaningful result of the given type
      • visitPart

        protected void visitPart​(@NonNull
                                 gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item,
                                 @NonNull
                                 gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem 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 part
        groupOrControl - the part's parent Metapath item
        state - the calling context information
      • visitMetadata

        protected void visitMetadata​(@NonNull
                                     gov.nist.secauto.metaschema.model.common.metapath.item.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 Metaschema node item containing the "metadata" node
        state - the calling context information
      • visitRole

        protected void visitRole​(@NonNull
                                 gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item,
                                 @NonNull
                                 gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem 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 Metaschema node item which is a child of the "metadata" node
        metadataItem - the "metadata" Metaschema node item containing the role
        state - the calling context information
      • visitLocation

        protected void visitLocation​(@NonNull
                                     gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item,
                                     @NonNull
                                     gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem 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 Metaschema node item which is a child of the "metadata" node
        metadataItem - the "metadata" Metaschema node item containing the location
        state - the calling context information
      • visitParty

        protected void visitParty​(@NonNull
                                  gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item,
                                  @NonNull
                                  gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem 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 Metaschema node item which is a child of the "metadata" node
        metadataItem - the "metadata" Metaschema node item containing the party
        state - the calling context information
      • visitBackMatter

        protected void visitBackMatter​(@NonNull
                                       gov.nist.secauto.metaschema.model.common.metapath.item.IRootAssemblyNodeItem rootItem,
                                       T state)
        Called when visiting the "back-matter" section of an OSCAL document.

        Visits each contained resource.

        Parameters:
        rootItem - the root Metaschema node item containing the "back-matter" node
        state - the calling context information
      • visitResource

        protected void visitResource​(@NonNull
                                     gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem item,
                                     @NonNull
                                     gov.nist.secauto.metaschema.model.common.metapath.item.IRootAssemblyNodeItem backMatterItem,
                                     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:
        item - the resource Metaschema node item which is a child of the "metadata" node
        backMatterItem - the resource Metaschema node item containing the party
        state - the calling context information