Class PropertyReferencePolicy
- java.lang.Object
-
- gov.nist.secauto.oscal.lib.profile.resolver.policy.AbstractCustomReferencePolicy<TYPE>
-
- gov.nist.secauto.oscal.lib.profile.resolver.policy.AbstractMultiItemTypeReferencePolicy<Property>
-
- gov.nist.secauto.oscal.lib.profile.resolver.policy.PropertyReferencePolicy
-
- All Implemented Interfaces:
ICustomReferencePolicy<Property>,IReferencePolicy<Property>
public class PropertyReferencePolicy extends AbstractMultiItemTypeReferencePolicy<Property>
-
-
Field Summary
-
Fields inherited from interface gov.nist.secauto.oscal.lib.profile.resolver.policy.IReferencePolicy
IGNORE_POLICY
-
-
Constructor Summary
Constructors Constructor Description PropertyReferencePolicy(IIdentifierParser identifierParser, List<IEntityItem.ItemType> itemTypes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PropertyReferencePolicycreate(IIdentifierParser identifierParser, IEntityItem.ItemType itemType)static PropertyReferencePolicycreate(IIdentifierParser identifierParser, List<IEntityItem.ItemType> itemTypes)StringgetReferenceText(Property property)Retrieve the reference text from thereferenceobject.protected booleanhandleIndexMiss(gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem contextItem, Property property, 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, Property property, IEntityItem item, ReferenceCountingVisitor.Context visitorContext)Handle an index hit against an item related to an unselected control.voidsetReferenceText(Property property, String newValue)Update the reference text used in thereferenceobject.-
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, handleIdentifierNonMatch, handleIndexHit, handleReference, handleSelected
-
-
-
-
Constructor Detail
-
PropertyReferencePolicy
public PropertyReferencePolicy(@NonNull IIdentifierParser identifierParser, @NonNull List<IEntityItem.ItemType> itemTypes)
-
-
Method Detail
-
create
@NonNull public static PropertyReferencePolicy create(@NonNull IIdentifierParser identifierParser, @NonNull IEntityItem.ItemType itemType)
-
create
@NonNull public static PropertyReferencePolicy create(@NonNull IIdentifierParser identifierParser, @NonNull List<IEntityItem.ItemType> itemTypes)
-
getReferenceText
public String getReferenceText(@NonNull Property property)
Description copied from interface:ICustomReferencePolicyRetrieve the reference text from thereferenceobject.- Parameters:
property- the reference object- Returns:
- the reference text or
nullif there is no text
-
setReferenceText
public void setReferenceText(@NonNull Property property, @NonNull String newValue)
Description copied from interface:ICustomReferencePolicyUpdate the reference text used in thereferenceobject.- Parameters:
property- the reference objectnewValue- the reference text replacement
-
handleUnselected
protected void handleUnselected(@NonNull gov.nist.secauto.metaschema.model.common.metapath.item.IRequiredValueModelNodeItem contextItem, @NonNull Property property, @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<Property>- Parameters:
contextItem- the node containing the identifier referenceproperty- 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 Property property, @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<Property>- Parameters:
contextItem- the node containing the identifier referenceproperty- 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
-
-