Package dev.amp.validator
Class TagSpecDispatch
- java.lang.Object
-
- dev.amp.validator.TagSpecDispatch
-
public class TagSpecDispatch extends Object
This class stores the dispatch rules for all TagSpecs with the same tag name.- Author:
- nhant01, GeorgeLuo
-
-
Constructor Summary
Constructors Constructor Description TagSpecDispatch()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Integer>allTagSpecs()Returns the tag specs.booleanempty()Returns true if dispatch key is not null and tag specs is not empty.booleanhasDispatchKeys()Returns true if tag spec key by dispatch not null.booleanhasTagSpecs()Return true if tag specs not empty.List<Integer>matchingDispatchKey(String attrName, String attrValue, String mandatoryParent)Looks up a dispatch key as previously registered, returning the corresponding tagSpecIds which are ordered by their specificity of match (e.g.voidregisterDispatchKey(String dispatchKey, int tagSpecId)Registers a new dispatch key to match a tagspec idvoidregisterTagSpec(int tagSpecId)Registers a new non dispatch key tagspec id.
-
-
-
Method Detail
-
registerDispatchKey
public void registerDispatchKey(@Nonnull String dispatchKey, int tagSpecId)Registers a new dispatch key to match a tagspec id- Parameters:
dispatchKey- the dispatch key.tagSpecId- tag spec id.
-
matchingDispatchKey
public List<Integer> matchingDispatchKey(@Nonnull String attrName, @Nonnull String attrValue, @Nonnull String mandatoryParent)
Looks up a dispatch key as previously registered, returning the corresponding tagSpecIds which are ordered by their specificity of match (e.g. Name/Value/Parent, then Name/Value, and then Name).- Parameters:
attrName- attribute name.attrValue- attribute value.mandatoryParent- mandatory parent.- Returns:
- returns the list of tag spec ids.
-
registerTagSpec
public void registerTagSpec(int tagSpecId)
Registers a new non dispatch key tagspec id.- Parameters:
tagSpecId- tag spec id.
-
empty
public boolean empty()
Returns true if dispatch key is not null and tag specs is not empty.- Returns:
- returns true if dispatch key is not null and tag specs is not empty.
-
hasDispatchKeys
public boolean hasDispatchKeys()
Returns true if tag spec key by dispatch not null.- Returns:
- returns true if tag spec key by dispatch not null.
-
hasTagSpecs
public boolean hasTagSpecs()
Return true if tag specs not empty.- Returns:
- returns true if tag specs not empty.
-
-