Class InsertReferencePolicy
- java.lang.Object
-
- gov.nist.secauto.oscal.lib.profile.resolver.policy.AbstractCustomReferencePolicy<gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode>
-
- gov.nist.secauto.oscal.lib.profile.resolver.policy.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>
-
-
Field Summary
-
Fields inherited from interface gov.nist.secauto.oscal.lib.profile.resolver.policy.IReferencePolicy
IGNORE_POLICY
-
-
Constructor Summary
Constructors Constructor Description InsertReferencePolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<IEntityItem.ItemType>getEntityItemTypes(gov.nist.secauto.metaschema.model.common.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.StringgetReferenceText(gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert)Retrieve the reference text from thereferenceobject.protected booleanhandleIndexMiss(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem contextItem, gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert, List<IEntityItem.ItemType> itemTypes, String identifier, ReferenceCountingVisitor.Context visitorContext)Handle an index miss for a reference.voidsetReferenceText(gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert, String newReference)Update the reference text used in thereferenceobject.-
Methods inherited from class gov.nist.secauto.oscal.lib.profile.resolver.policy.AbstractCustomReferencePolicy
getIdentifierParser, handleIdentifier, handleIdentifierNonMatch, handleIndexHit, handleReference, handleSelected, handleUnselected
-
-
-
-
Constructor Detail
-
InsertReferencePolicy
public InsertReferencePolicy()
-
-
Method Detail
-
getEntityItemTypes
protected List<IEntityItem.ItemType> getEntityItemTypes(@NonNull gov.nist.secauto.metaschema.model.common.datatype.markup.flexmark.InsertAnchorExtension.InsertAnchorNode insert)
Description copied from class:AbstractCustomReferencePolicyGet the possible item types that can be searched in the order in which the identifier will be looked up.The
referenceobject is provided to allow for context sensitive item type tailoring.- Specified by:
getEntityItemTypesin classAbstractCustomReferencePolicy<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:ICustomReferencePolicyRetrieve the reference text from thereferenceobject.- Parameters:
insert- the reference object- Returns:
- the reference text or
nullif 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:ICustomReferencePolicyUpdate the reference text used in thereferenceobject.- Parameters:
insert- the reference objectnewReference- 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:AbstractCustomReferencePolicyHandle 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:
handleIndexMissin classAbstractCustomReferencePolicy<gov.nist.secauto.metaschema.model.common.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:
trueif the reference is handled by this method orfalseotherwise
-
-