Class ItemRuleUtils


  • public class ItemRuleUtils
    extends java.lang.Object
    Miscellaneous ItemRule utility methods.
    Since:
    6.3.0
    • Method Detail

      • getPrototypeClass

        public static java.lang.Class<?> getPrototypeClass​(ItemRule itemRule,
                                                           java.lang.Object value)
        Returns the Class according to the given item value. If the type of the item value is unknown, the class of the value actually assigned is returned.
        Parameters:
        itemRule - the item rule
        value - the value actually assigned to the item
        Returns:
        a Class determined by the type of item or its actual value
      • tokenIterator

        public static java.util.Iterator<Token[]> tokenIterator​(ItemRule itemRule)
        Returns an Iterator of all the tokens the item has.
        Parameters:
        itemRule - the item rule
        Returns:
        an Iterator for all tokens
      • toItemRuleMap

        public static ItemRuleMap toItemRuleMap​(java.util.List<ItemParameters> itemParametersList)
                                         throws IllegalRuleException
        Convert the given ItemParameters list into an ItemRuleMap.
        Parameters:
        itemParametersList - the ItemParameters list to convert
        Returns:
        the item rule map
        Throws:
        IllegalRuleException - if an illegal rule is found
      • toItemRuleList

        public static ItemRuleList toItemRuleList​(java.util.List<ItemParameters> itemParametersList)
                                           throws IllegalRuleException
        Convert the given ItemParameters list into an ItemRuleList.
        Parameters:
        itemParametersList - the ItemParameters list to convert
        Returns:
        the item rule list
        Throws:
        IllegalRuleException - if an illegal rule is found