Class LinkReferencePolicy
java.lang.Object
gov.nist.secauto.oscal.lib.profile.resolver.policy.AbstractCustomReferencePolicy<TYPE>
gov.nist.secauto.oscal.lib.profile.resolver.policy.AbstractMultiItemTypeReferencePolicy<Link>
gov.nist.secauto.oscal.lib.profile.resolver.policy.LinkReferencePolicy
- All Implemented Interfaces:
ICustomReferencePolicy<Link>
,IReferencePolicy<Link>
-
Field Summary
Fields inherited from interface gov.nist.secauto.oscal.lib.profile.resolver.policy.IReferencePolicy
IGNORE_POLICY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LinkReferencePolicy
create
(IEntityItem.ItemType itemType) static LinkReferencePolicy
create
(List<IEntityItem.ItemType> itemTypes) getReferenceText
(Link link) Retrieve the reference text from thereference
object.protected boolean
handleIdentifierNonMatch
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> contextItem, Link reference, ReferenceCountingVisitor.Context visitorContext) Handle the case where the identifier was not a syntax match for an expected identifier.protected boolean
handleIndexMiss
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> contextItem, Link link, List<IEntityItem.ItemType> itemTypes, String identifier, ReferenceCountingVisitor.Context visitorContext) Handle an index miss for a reference.protected void
handleUnselected
(gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> contextItem, Link link, IEntityItem item, ReferenceCountingVisitor.Context visitorContext) Handle an index hit against an item related to an unselected control.void
setReferenceText
(Link link, String newValue) Update the reference text used in thereference
object.Methods inherited from class gov.nist.secauto.oscal.lib.profile.resolver.policy.AbstractMultiItemTypeReferencePolicy
getEntityItemTypes
Methods inherited from class gov.nist.secauto.oscal.lib.profile.resolver.policy.AbstractCustomReferencePolicy
getIdentifierParser, handleIdentifier, handleIndexHit, handleReference, handleSelected
-
Constructor Details
-
LinkReferencePolicy
-
-
Method Details
-
create
-
create
-
getReferenceText
Description copied from interface:ICustomReferencePolicy
Retrieve the reference text from thereference
object.- Parameters:
link
- the reference object- Returns:
- the reference text or
null
if there is no text
-
setReferenceText
Description copied from interface:ICustomReferencePolicy
Update the reference text used in thereference
object.- Parameters:
link
- the reference objectnewValue
- the reference text replacement
-
handleUnselected
protected void handleUnselected(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> contextItem, @NonNull Link link, @NonNull IEntityItem item, @NonNull ReferenceCountingVisitor.Context visitorContext) Description copied from class:AbstractCustomReferencePolicy
Handle an index hit against an item related to an unselected control.Subclasses can override this method to perform extra processing.
- Overrides:
handleUnselected
in classAbstractCustomReferencePolicy<Link>
- 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.core.metapath.item.node.IModelNodeItem<?, ?> contextItem, @NonNull Link link, @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<Link>
- Parameters:
contextItem
- the node containing the identifier referencelink
- 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
-
handleIdentifierNonMatch
protected boolean handleIdentifierNonMatch(@NonNull gov.nist.secauto.metaschema.core.metapath.item.node.IModelNodeItem<?, ?> contextItem, @NonNull Link reference, @NonNull ReferenceCountingVisitor.Context visitorContext) Description copied from class:AbstractCustomReferencePolicy
Handle 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:
handleIdentifierNonMatch
in classAbstractCustomReferencePolicy<Link>
- 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:
true
if the reference is handled by this method orfalse
otherwise
-