Class AnchorReferencePolicy
- java.lang.Object
-
- gov.nist.secauto.oscal.lib.profile.resolver.policy.AbstractCustomReferencePolicy<com.vladsch.flexmark.ast.InlineLinkNode>
-
- gov.nist.secauto.oscal.lib.profile.resolver.policy.AnchorReferencePolicy
-
- All Implemented Interfaces:
ICustomReferencePolicy<com.vladsch.flexmark.ast.InlineLinkNode>,IReferencePolicy<com.vladsch.flexmark.ast.InlineLinkNode>
public class AnchorReferencePolicy extends AbstractCustomReferencePolicy<com.vladsch.flexmark.ast.InlineLinkNode>
-
-
Field Summary
-
Fields inherited from interface gov.nist.secauto.oscal.lib.profile.resolver.policy.IReferencePolicy
IGNORE_POLICY
-
-
Constructor Summary
Constructors Constructor Description AnchorReferencePolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<IEntityItem.ItemType>getEntityItemTypes(com.vladsch.flexmark.ast.InlineLinkNode link)Get the possible item types that can be searched in the order in which the identifier will be looked up.StringgetReferenceText(com.vladsch.flexmark.ast.InlineLinkNode link)Retrieve the reference text from thereferenceobject.protected booleanhandleIdentifierNonMatch(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem contextItem, com.vladsch.flexmark.ast.InlineLinkNode reference, ReferenceCountingVisitor.Context visitorContext)Handle the case where the identifier was not a syntax match for an expected identifier.protected booleanhandleIndexMiss(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem contextItem, com.vladsch.flexmark.ast.InlineLinkNode reference, List<IEntityItem.ItemType> itemTypes, String identifier, ReferenceCountingVisitor.Context visitorContext)Handle an index miss for a reference.protected voidhandleUnselected(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem contextItem, com.vladsch.flexmark.ast.InlineLinkNode link, IEntityItem item, ReferenceCountingVisitor.Context visitorContext)Handle an index hit against an item related to an unselected control.voidsetReferenceText(com.vladsch.flexmark.ast.InlineLinkNode link, String newValue)Update the reference text used in thereferenceobject.-
Methods inherited from class gov.nist.secauto.oscal.lib.profile.resolver.policy.AbstractCustomReferencePolicy
getIdentifierParser, handleIdentifier, handleIndexHit, handleReference, handleSelected
-
-
-
-
Constructor Detail
-
AnchorReferencePolicy
public AnchorReferencePolicy()
-
-
Method Detail
-
getEntityItemTypes
protected List<IEntityItem.ItemType> getEntityItemTypes(@NonNull com.vladsch.flexmark.ast.InlineLinkNode link)
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<com.vladsch.flexmark.ast.InlineLinkNode>- Parameters:
link- the reference object- Returns:
- a list of item types to search for
-
getReferenceText
public String getReferenceText(@NonNull com.vladsch.flexmark.ast.InlineLinkNode link)
Description copied from interface:ICustomReferencePolicyRetrieve the reference text from thereferenceobject.- Parameters:
link- the reference object- Returns:
- the reference text or
nullif there is no text
-
setReferenceText
public void setReferenceText(@NonNull com.vladsch.flexmark.ast.InlineLinkNode link, @NonNull String newValue)
Description copied from interface:ICustomReferencePolicyUpdate the reference text used in thereferenceobject.- Parameters:
link- the reference objectnewValue- the reference text replacement
-
handleUnselected
protected void handleUnselected(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem contextItem, @NonNull com.vladsch.flexmark.ast.InlineLinkNode link, @NonNull IEntityItem item, @NonNull ReferenceCountingVisitor.Context visitorContext)
Description copied from class:AbstractCustomReferencePolicyHandle an index hit against an item related to an unselected control.Subclasses can override this method to perform extra processing.
- Overrides:
handleUnselectedin classAbstractCustomReferencePolicy<com.vladsch.flexmark.ast.InlineLinkNode>- Parameters:
contextItem- the node containing the identifier referencelink- the identifier reference object generating the hititem- the referenced itemvisitorContext- the reference visitor, which can be used for further processing
-
handleIndexMiss
protected boolean handleIndexMiss(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem contextItem, @NonNull com.vladsch.flexmark.ast.InlineLinkNode reference, @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<com.vladsch.flexmark.ast.InlineLinkNode>- Parameters:
contextItem- the node containing the identifier referencereference- 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
-
handleIdentifierNonMatch
protected boolean handleIdentifierNonMatch(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem contextItem, @NonNull com.vladsch.flexmark.ast.InlineLinkNode reference, @NonNull ReferenceCountingVisitor.Context visitorContext)
Description copied from class:AbstractCustomReferencePolicyHandle the case where the identifier was not a syntax match for an expected identifier. This can occur when the reference is malformed, using an unrecognized syntax.Subclasses can override this method to perform extra processing.
- Overrides:
handleIdentifierNonMatchin classAbstractCustomReferencePolicy<com.vladsch.flexmark.ast.InlineLinkNode>- Parameters:
contextItem- the node containing the identifier referencereference- the identifier reference object generating the hitvisitorContext- the reference visitor state, which can be used for further processing- Returns:
trueif the reference is handled by this method orfalseotherwise
-
-