Class InsertReferencePolicy
java.lang.Object
gov.nist.secauto.oscal.lib.profile.resolver.policy.AbstractCustomReferencePolicy<gov.nist.secauto.metaschema.core.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode>
gov.nist.secauto.oscal.lib.profile.resolver.policy.InsertReferencePolicy
- All Implemented Interfaces:
ICustomReferencePolicy<gov.nist.secauto.metaschema.core.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode>
,IReferencePolicy<gov.nist.secauto.metaschema.core.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode>
public class InsertReferencePolicy
extends AbstractCustomReferencePolicy<gov.nist.secauto.metaschema.core.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode>
-
Field Summary
Fields inherited from interface gov.nist.secauto.oscal.lib.profile.resolver.policy.IReferencePolicy
IGNORE_POLICY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected List<IEntityItem.ItemType>
getEntityItemTypes
(gov.nist.secauto.metaschema.core.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert) Get the possible item types that can be searched in the order in which the identifier will be looked up.getReferenceText
(gov.nist.secauto.metaschema.core.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert) Retrieve the reference text from thereference
object.protected boolean
handleIndexMiss
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> contextItem, gov.nist.secauto.metaschema.core.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert, List<IEntityItem.ItemType> itemTypes, String identifier, ReferenceCountingVisitor.Context visitorContext) Handle an index miss for a reference.void
setReferenceText
(gov.nist.secauto.metaschema.core.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert, String newReference) Update the reference text used in thereference
object.Methods inherited from class gov.nist.secauto.oscal.lib.profile.resolver.policy.AbstractCustomReferencePolicy
getIdentifierParser, handleIdentifier, handleIdentifierNonMatch, handleIndexHit, handleReference, handleSelected, handleUnselected
-
Constructor Details
-
InsertReferencePolicy
public InsertReferencePolicy()
-
-
Method Details
-
getEntityItemTypes
protected List<IEntityItem.ItemType> getEntityItemTypes(@NonNull gov.nist.secauto.metaschema.core.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 classAbstractCustomReferencePolicy<gov.nist.secauto.metaschema.core.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.core.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert) Description copied from interface:ICustomReferencePolicy
Retrieve the reference text from thereference
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.core.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert, @NonNull String newReference) Description copied from interface:ICustomReferencePolicy
Update the reference text used in thereference
object.- Parameters:
insert
- the reference objectnewReference
- the reference text replacement
-
handleIndexMiss
protected boolean handleIndexMiss(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> contextItem, @NonNull gov.nist.secauto.metaschema.core.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 classAbstractCustomReferencePolicy<gov.nist.secauto.metaschema.core.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode>
- Parameters:
contextItem
- the node containing the identifier referenceinsert
- the identifier reference object generating the hititemTypes
- the possible item types for this referenceidentifier
- the parsed identifiervisitorContext
- the reference visitor state, which can be used for further processing- Returns:
true
if the reference is handled by this method orfalse
otherwise
-