Package com.aspectran.core.context.rule
Class ItemRuleUtils
- java.lang.Object
-
- com.aspectran.core.context.rule.ItemRuleUtils
-
public class ItemRuleUtils extends java.lang.ObjectMiscellaneousItemRuleutility methods.- Since:
- 6.3.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class<?>getPrototypeClass(ItemRule itemRule, java.lang.Object value)Returns theClassaccording to the given item value.static ItemRuletoItemRule(ItemParameters itemParameters)Convert the givenItemParametersinto anItemRule.static ItemRuleListtoItemRuleList(java.util.List<ItemParameters> itemParametersList)Convert the givenItemParameterslist into anItemRuleList.static ItemRuleMaptoItemRuleMap(Attribute[] attributes)static ItemRuleMaptoItemRuleMap(Parameter[] parameters)static ItemRuleMaptoItemRuleMap(java.util.List<ItemParameters> itemParametersList)Convert the givenItemParameterslist into anItemRuleMap.static java.util.Iterator<Token[]>tokenIterator(ItemRule itemRule)Returns anIteratorof all the tokens the item has.
-
-
-
Method Detail
-
getPrototypeClass
public static java.lang.Class<?> getPrototypeClass(ItemRule itemRule, java.lang.Object value)
Returns theClassaccording 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 rulevalue- the value actually assigned to the item- Returns:
- a
Classdetermined by the type of item or its actual value
-
tokenIterator
public static java.util.Iterator<Token[]> tokenIterator(ItemRule itemRule)
Returns anIteratorof all the tokens the item has.- Parameters:
itemRule- the item rule- Returns:
- an
Iteratorfor all tokens
-
toItemRuleMap
public static ItemRuleMap toItemRuleMap(java.util.List<ItemParameters> itemParametersList) throws IllegalRuleException
Convert the givenItemParameterslist into anItemRuleMap.- 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 givenItemParameterslist into anItemRuleList.- Parameters:
itemParametersList- the ItemParameters list to convert- Returns:
- the item rule list
- Throws:
IllegalRuleException- if an illegal rule is found
-
toItemRule
public static ItemRule toItemRule(ItemParameters itemParameters) throws IllegalRuleException
Convert the givenItemParametersinto anItemRule.- Parameters:
itemParameters- the item parameters- Returns:
- an instance of
ItemRule - Throws:
IllegalRuleException- if an illegal rule is found
-
toItemRuleMap
public static ItemRuleMap toItemRuleMap(Parameter[] parameters) throws IllegalRuleException
- Throws:
IllegalRuleException
-
toItemRuleMap
public static ItemRuleMap toItemRuleMap(Attribute[] attributes) throws IllegalRuleException
- Throws:
IllegalRuleException
-
-