Class InsertReferencePolicy

  • All Implemented Interfaces:
    ICustomReferencePolicy<gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode>, IReferencePolicy<gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode>

    public class InsertReferencePolicy
    extends AbstractCustomReferencePolicy<gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode>
    • Method Detail

      • getEntityItemTypes

        protected List<IEntityItem.ItemTypegetEntityItemTypes​(@NonNull
                                                                gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert)
        Description copied from class: AbstractCustomReferencePolicy
        Get the possible item types that can be searched in the order in which the identifier will be looked up.

        The reference object is provided to allow for context sensitive item type tailoring.

        Specified by:
        getEntityItemTypes in class AbstractCustomReferencePolicy<gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode>
        Parameters:
        insert - the reference object
        Returns:
        a list of item types to search for
      • getReferenceText

        public String getReferenceText​(@NonNull
                                       gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert)
        Description copied from interface: ICustomReferencePolicy
        Retrieve the reference text from the reference object.
        Parameters:
        insert - the reference object
        Returns:
        the reference text or null if there is no text
      • setReferenceText

        public void setReferenceText​(@NonNull
                                     gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert,
                                     @NonNull
                                     String newReference)
        Description copied from interface: ICustomReferencePolicy
        Update the reference text used in the reference object.
        Parameters:
        insert - the reference object
        newReference - the reference text replacement
      • handleIndexMiss

        protected boolean handleIndexMiss​(@NonNull
                                          gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem contextItem,
                                          @NonNull
                                          gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert,
                                          @NonNull
                                          List<IEntityItem.ItemType> itemTypes,
                                          @NonNull
                                          String identifier,
                                          @NonNull
                                          ReferenceCountingVisitor.Context visitorContext)
        Description copied from class: AbstractCustomReferencePolicy
        Handle an index miss for a reference. This occurs when the referenced item was not found in the index.

        Subclasses can override this method to perform extra processing.

        Overrides:
        handleIndexMiss in class AbstractCustomReferencePolicy<gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode>
        Parameters:
        contextItem - the node containing the identifier reference
        insert - the identifier reference object generating the hit
        itemTypes - the possible item types for this reference
        identifier - the parsed identifier
        visitorContext - the reference visitor state, which can be used for further processing
        Returns:
        true if the reference is handled by this method or false otherwise