Package com.aspectran.core.context.rule
Class ItemRuleUtils
- java.lang.Object
-
- com.aspectran.core.context.rule.ItemRuleUtils
-
public class ItemRuleUtils extends java.lang.Object
MiscellaneousItemRule
utility 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 theClass
according to the given item value.static ItemRule
toItemRule(ItemParameters itemParameters)
Convert the givenItemParameters
into anItemRule
.static ItemRuleList
toItemRuleList(java.util.List<ItemParameters> itemParametersList)
Convert the givenItemParameters
list into anItemRuleList
.static ItemRuleMap
toItemRuleMap(Attribute[] attributes)
static ItemRuleMap
toItemRuleMap(Parameter[] parameters)
static ItemRuleMap
toItemRuleMap(java.util.List<ItemParameters> itemParametersList)
Convert the givenItemParameters
list into anItemRuleMap
.static java.util.Iterator<Token[]>
tokenIterator(ItemRule itemRule)
Returns anIterator
of all the tokens the item has.
-
-
-
Method Detail
-
getPrototypeClass
public static java.lang.Class<?> getPrototypeClass(ItemRule itemRule, java.lang.Object value)
Returns theClass
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 rulevalue
- 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 anIterator
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 givenItemParameters
list 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 givenItemParameters
list 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 givenItemParameters
into 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
-
-