Interface ICustomReferencePolicyHandler<TYPE>
- All Known Implementing Classes:
AbstractIndexMissPolicyHandler
public interface ICustomReferencePolicyHandler<TYPE>
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanhandleIdentifierNonMatch(ICustomReferencePolicy<TYPE> policy, TYPE reference, IReferenceVisitor<?> visitor) A callback used to handle the case where an identifier could not be parsed from the reference text.default booleanhandleIndexHit(ICustomReferencePolicy<TYPE> policy, TYPE reference, IEntityItem item, IReferenceVisitor<?> visitor) A callback used to handle the case where an identifier could be parsed and the index contains a matching entity.default booleanhandleIndexMiss(ICustomReferencePolicy<TYPE> policy, TYPE reference, List<IEntityItem.ItemType> itemTypes, String identifier, IReferenceVisitor<?> visitor) A callback used to handle the case where an identifier could be parsed from the reference text, but the index didn't contain a matching entity.
-
Field Details
-
IGNORE_INDEX_MISS_POLICY
-
-
Method Details
-
handleIdentifierNonMatch
default boolean handleIdentifierNonMatch(@NonNull ICustomReferencePolicy<TYPE> policy, @NonNull TYPE reference, @NonNull IReferenceVisitor<?> visitor) A callback used to handle the case where an identifier could not be parsed from the reference text.- Parameters:
policy- the reference policy for this referencereference- the reference objectvisitor- the reference visitor used to resolve referenced objects- Returns:
trueif the reference is considered handled, orfalseotherwise
-
handleIndexMiss
default boolean handleIndexMiss(@NonNull ICustomReferencePolicy<TYPE> policy, @NonNull TYPE reference, @NonNull List<IEntityItem.ItemType> itemTypes, @NonNull String identifier, @NonNull IReferenceVisitor<?> visitor) A callback used to handle the case where an identifier could be parsed from the reference text, but the index didn't contain a matching entity.- Parameters:
policy- the reference policy for this referencereference- the reference objectitemTypes- the item types that were checkedidentifier- the parsed identifiervisitor- the reference visitor used to resolve referenced objects- Returns:
trueif the reference is considered handled, orfalseotherwise
-
handleIndexHit
default boolean handleIndexHit(@NonNull ICustomReferencePolicy<TYPE> policy, @NonNull TYPE reference, @NonNull IEntityItem item, @NonNull IReferenceVisitor<?> visitor) A callback used to handle the case where an identifier could be parsed and the index contains a matching entity.- Parameters:
policy- the reference policy for this referencereference- the reference objectitem- the entity that is referencedvisitor- the reference visitor used to resolve referenced objects- Returns:
trueif the reference is considered handled, orfalseotherwise
-