Package com.aspectran.core.context.rule
Class ItemRule
- java.lang.Object
-
- com.aspectran.core.context.rule.ItemRule
-
public class ItemRule extends java.lang.Object
The Class ItemRule.Created: 2008. 03. 27 PM 3:57:48
-
-
Constructor Summary
Constructors Constructor Description ItemRule()
Instantiates a new ItemRule.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBeanRule(BeanRule beanRule)
void
addValue(Token[] tokens)
Adds the specified value to this List type item.void
addValue(java.lang.String text)
Adds the specified value to this List type item.boolean
containsToken(Token token)
Token[]
getAllTokens()
BeanRule
getBeanRule()
java.util.List<BeanRule>
getBeanRuleList()
java.util.Map<java.lang.String,BeanRule>
getBeanRuleMap()
java.lang.Boolean
getMandatory()
Returns whether this item is mandatory.java.lang.String
getName()
Returns the name of the item.java.lang.Boolean
getSecret()
Returns whether this item requires secure input.java.lang.Boolean
getTokenize()
Returns whether to tokenize.Token[]
getTokens()
Gets the tokens.java.util.List<Token[]>
getTokensList()
Gets the list of tokens.java.util.Map<java.lang.String,Token[]>
getTokensMap()
Gets the tokens map.ItemType
getType()
Gets the item type.java.lang.String
getValue()
Returns the value of the item.java.util.List<java.lang.String>
getValueList()
Returns a list of string values of this item.java.util.Map<java.lang.String,java.lang.String>
getValueMap()
Returns a map of string values of this item.ItemValueType
getValueType()
Gets the value type of this item.boolean
isAutoNamed()
Returns whether the item name was auto generated.boolean
isListableType()
Return whether this item is listable type.boolean
isMandatory()
Returns whether this item is mandatory.boolean
isMappableType()
Return whether this item is mappable type.boolean
isSecret()
Returns whether this item requires secure input.boolean
isTokenize()
Returns whether tokenize.static ItemRule
newInstance(java.lang.String type, java.lang.String name, java.lang.String valueType, java.lang.Boolean tokenize, java.lang.Boolean mandatory, java.lang.Boolean secret)
Returns a new derived instance of ItemRule.void
putBeanRule(java.lang.String name, BeanRule beanRule)
void
putValue(java.lang.String name, Token[] tokens)
Puts the specified value with the specified key to this Map type item.void
putValue(java.lang.String name, java.lang.String text)
Puts the specified value with the specified key to this Map type item.void
setAutoNamed(boolean autoNamed)
Sets whether the item is an auto generated name.void
setBeanRule(BeanRule beanRule)
void
setMandatory(java.lang.Boolean mandatory)
Sets whether this item is mandatory.void
setName(java.lang.String name)
Sets the name of the item.void
setSecret(java.lang.Boolean secret)
Sets whether this item requires secure input.void
setTokenize(java.lang.Boolean tokenize)
Sets whether tokenize.void
setType(ItemType type)
Sets the item type.void
setValue(Token[] tokens)
Sets the specified value to this Single type item.void
setValue(java.lang.String text)
Sets the specified value to this Single type item.void
setValue(java.util.List<Token[]> tokensList)
Sets a value to this List type item.void
setValue(java.util.Map<java.lang.String,Token[]> tokensMap)
Sets a value to this Map type item.void
setValue(java.util.Properties properties)
Sets a value to this Properties type item.void
setValue(java.util.Set<Token[]> tokensSet)
Sets a value to this Set type item.void
setValueType(ItemValueType valueType)
Sets the value type of this item.java.lang.String
toString()
-
-
-
Method Detail
-
getType
public ItemType getType()
Gets the item type.- Returns:
- the item type
-
setType
public void setType(ItemType type)
Sets the item type.- Parameters:
type
- the new item type
-
getName
public java.lang.String getName()
Returns the name of the item.- Returns:
- the name of the item
-
setName
public void setName(java.lang.String name)
Sets the name of the item.- Parameters:
name
- the name to set
-
getValue
public java.lang.String getValue()
Returns the value of the item.- Returns:
- the value of the item
-
getTokens
public Token[] getTokens()
Gets the tokens.- Returns:
- the tokens
-
getTokensList
public java.util.List<Token[]> getTokensList()
Gets the list of tokens.- Returns:
- the tokens list
-
getValueList
public java.util.List<java.lang.String> getValueList()
Returns a list of string values of this item.- Returns:
- a list of string values
-
getTokensMap
public java.util.Map<java.lang.String,Token[]> getTokensMap()
Gets the tokens map.- Returns:
- the tokens map
-
getValueMap
public java.util.Map<java.lang.String,java.lang.String> getValueMap()
Returns a map of string values of this item.- Returns:
- a map of string values
-
setValue
public void setValue(java.lang.String text)
Sets the specified value to this Single type item.- Parameters:
text
- the value to be analyzed for use as the value of this item- See Also:
setValue(Token[])
-
setValue
public void setValue(Token[] tokens)
Sets the specified value to this Single type item.- Parameters:
tokens
- an array of tokens
-
putValue
public void putValue(java.lang.String name, java.lang.String text)
Puts the specified value with the specified key to this Map type item.- Parameters:
name
- the value name; may be nulltext
- the value to be analyzed for use as the value of this item- See Also:
putValue(String, Token[])
-
putValue
public void putValue(java.lang.String name, Token[] tokens)
Puts the specified value with the specified key to this Map type item.- Parameters:
name
- the value name; may be nulltokens
- an array of tokens
-
setValue
public void setValue(java.util.Map<java.lang.String,Token[]> tokensMap)
Sets a value to this Map type item.- Parameters:
tokensMap
- the tokens map
-
setValue
public void setValue(java.util.Properties properties)
Sets a value to this Properties type item.- Parameters:
properties
- the properties
-
addValue
public void addValue(java.lang.String text)
Adds the specified value to this List type item.- Parameters:
text
- the value to be analyzed for use as the value of this item- See Also:
addValue(Token[])
-
addValue
public void addValue(Token[] tokens)
Adds the specified value to this List type item.- Parameters:
tokens
- an array of tokens
-
setValue
public void setValue(java.util.List<Token[]> tokensList)
Sets a value to this List type item.- Parameters:
tokensList
- the tokens list
-
setValue
public void setValue(java.util.Set<Token[]> tokensSet)
Sets a value to this Set type item.- Parameters:
tokensSet
- the tokens set
-
getValueType
public ItemValueType getValueType()
Gets the value type of this item.- Returns:
- the value type of this item
-
setValueType
public void setValueType(ItemValueType valueType)
Sets the value type of this item.- Parameters:
valueType
- the new value type
-
getTokenize
public java.lang.Boolean getTokenize()
Returns whether to tokenize.- Returns:
- whether to tokenize
-
isTokenize
public boolean isTokenize()
Returns whether tokenize.- Returns:
- whether tokenize
-
setTokenize
public void setTokenize(java.lang.Boolean tokenize)
Sets whether tokenize.- Parameters:
tokenize
- whether tokenize
-
isAutoNamed
public boolean isAutoNamed()
Returns whether the item name was auto generated.- Returns:
- true, if the item name was auto generated
-
setAutoNamed
public void setAutoNamed(boolean autoNamed)
Sets whether the item is an auto generated name.- Parameters:
autoNamed
- true, if the item name is auto generated
-
isListableType
public boolean isListableType()
Return whether this item is listable type.- Returns:
- true, if this item is listable type
-
isMappableType
public boolean isMappableType()
Return whether this item is mappable type.- Returns:
- true, if this item is mappable type
-
getMandatory
public java.lang.Boolean getMandatory()
Returns whether this item is mandatory.- Returns:
- whether or not this item is mandatory
-
isMandatory
public boolean isMandatory()
Returns whether this item is mandatory.- Returns:
- whether or not this item is mandatory
-
setMandatory
public void setMandatory(java.lang.Boolean mandatory)
Sets whether this item is mandatory.- Parameters:
mandatory
- whether or not this item is mandatory
-
getSecret
public java.lang.Boolean getSecret()
Returns whether this item requires secure input.- Returns:
- whether or not this item requires secure input
-
isSecret
public boolean isSecret()
Returns whether this item requires secure input.- Returns:
- whether or not this item requires secure input
-
setSecret
public void setSecret(java.lang.Boolean secret)
Sets whether this item requires secure input.- Parameters:
secret
- whether or not this item requires secure input
-
getAllTokens
public Token[] getAllTokens()
-
containsToken
public boolean containsToken(Token token)
-
getBeanRule
public BeanRule getBeanRule()
-
setBeanRule
public void setBeanRule(BeanRule beanRule)
-
getBeanRuleList
public java.util.List<BeanRule> getBeanRuleList()
-
addBeanRule
public void addBeanRule(BeanRule beanRule)
-
getBeanRuleMap
public java.util.Map<java.lang.String,BeanRule> getBeanRuleMap()
-
putBeanRule
public void putBeanRule(java.lang.String name, BeanRule beanRule)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
newInstance
public static ItemRule newInstance(java.lang.String type, java.lang.String name, java.lang.String valueType, java.lang.Boolean tokenize, java.lang.Boolean mandatory, java.lang.Boolean secret) throws IllegalRuleException
Returns a new derived instance of ItemRule.- Parameters:
type
- the item typename
- the name of the itemvalueType
- the type of value an item can havetokenize
- whether to tokenizemandatory
- whether or not this item is mandatorysecret
- whether or not this item requires secure input- Returns:
- the item rule
- Throws:
IllegalRuleException
- if an illegal rule is found
-
-