public class ItemRule
extends java.lang.Object
Created: 2008. 03. 27 PM 3:57:48
| Constructor | Description |
|---|---|
ItemRule() |
Instantiates a new ItemRule.
|
| Modifier and Type | Method | Description |
|---|---|---|
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() |
|
static java.lang.Class<?> |
getClassOfValue(ItemRule ir,
java.lang.Object value) |
Gets the class of value.
|
java.lang.String |
getDefaultValue() |
Gets the default value of this item.
|
java.lang.Boolean |
getMandatory() |
Returns whether this item is mandatory.
|
java.lang.String |
getName() |
Returns the name of the item.
|
java.lang.Boolean |
getSecurity() |
Returns whether this item requires security 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 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 |
isAutoGeneratedName() |
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 |
isSecurity() |
Returns whether this item requires security input.
|
boolean |
isTokenize() |
Returns whether tokenize.
|
static Token |
makeReferenceToken(java.lang.String bean,
java.lang.String template,
java.lang.String parameter,
java.lang.String attribute,
java.lang.String property) |
Returns a made reference token.
|
static ItemRule |
newInstance(java.lang.String type,
java.lang.String name,
java.lang.String valueType,
java.lang.String defaultValue,
java.lang.Boolean tokenize,
java.lang.Boolean mandatory,
java.lang.Boolean security) |
Returns a new derived instance of ItemRule.
|
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 |
setAutoGeneratedName(boolean autoGeneratedName) |
Sets whether the item is an auto generated name.
|
void |
setDefaultValue(java.lang.String defaultValue) |
Sets the default value of this item.
|
void |
setMandatory(java.lang.Boolean mandatory) |
Sets whether this item is mandatory.
|
void |
setName(java.lang.String name) |
Sets the name of a item.
|
void |
setSecurity(java.lang.Boolean security) |
Sets whether this item requires security 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.
|
static java.util.List<ItemParameters> |
toItemParametersList(java.lang.String text) |
Convert the given
String into an Item Parameters. |
static ItemRule |
toItemRule(ItemParameters itemParameters) |
Convert the given item parameters into an
ItemRule. |
static ItemRuleList |
toItemRuleList(java.util.List<ItemParameters> itemParametersList) |
Convert the given item parameters list into an
ItemRuleList. |
static ItemRuleMap |
toItemRuleMap(java.lang.String text) |
Convert the given
String into an ItemRuleMap. |
static ItemRuleMap |
toItemRuleMap(java.util.List<ItemParameters> itemParametersList) |
Convert the given item parameters list into an
ItemRuleMap. |
static java.util.Iterator<Token[]> |
tokenIterator(ItemRule itemRule) |
Returns a
Token iterator. |
java.lang.String |
toString() |
public ItemType getType()
public void setType(ItemType type)
type - the new item typepublic java.lang.String getName()
public void setName(java.lang.String name)
name - the name to setpublic java.lang.String getValue()
public Token[] getTokens()
public java.util.List<Token[]> getTokensList()
public java.util.List<java.lang.String> getValueList()
public java.util.Map<java.lang.String,Token[]> getTokensMap()
public java.util.Map<java.lang.String,java.lang.String> getValueMap()
public void setValue(java.lang.String text)
text - the value to be analyzed for use as the value of this itemsetValue(Token[])public void setValue(Token[] tokens)
tokens - an array of tokenspublic void putValue(java.lang.String name,
java.lang.String text)
name - the value name; may be nulltext - the value to be analyzed for use as the value of this itemputValue(String, Token[])public void putValue(java.lang.String name,
Token[] tokens)
name - the value name; may be nulltokens - an array of tokenspublic void setValue(java.util.Map<java.lang.String,Token[]> tokensMap)
tokensMap - the tokens mappublic void setValue(java.util.Properties properties)
properties - the propertiespublic void addValue(java.lang.String text)
text - the value to be analyzed for use as the value of this itemaddValue(Token[])public void addValue(Token[] tokens)
tokens - an array of tokenspublic void setValue(java.util.List<Token[]> tokensList)
tokensList - the tokens listpublic void setValue(java.util.Set<Token[]> tokensSet)
tokensSet - the tokens setpublic ItemValueType getValueType()
public void setValueType(ItemValueType valueType)
valueType - the new value typepublic java.lang.String getDefaultValue()
public void setDefaultValue(java.lang.String defaultValue)
defaultValue - the new default valuepublic java.lang.Boolean getTokenize()
public boolean isTokenize()
public void setTokenize(java.lang.Boolean tokenize)
tokenize - whether tokenizepublic boolean isAutoGeneratedName()
public void setAutoGeneratedName(boolean autoGeneratedName)
autoGeneratedName - true, if the item name is auto generatedpublic boolean isListableType()
public boolean isMappableType()
public java.lang.Boolean getMandatory()
public boolean isMandatory()
public void setMandatory(java.lang.Boolean mandatory)
mandatory - whether or not this item is mandatorypublic java.lang.Boolean getSecurity()
public boolean isSecurity()
public void setSecurity(java.lang.Boolean security)
security - whether or not this item requires security inputpublic Token[] getAllTokens()
public boolean containsToken(Token token)
public java.lang.String toString()
toString in class java.lang.Objectpublic static java.lang.Class<?> getClassOfValue(ItemRule ir, java.lang.Object value)
ir - the item rulevalue - the valuepublic static ItemRule newInstance(java.lang.String type, java.lang.String name, java.lang.String valueType, java.lang.String defaultValue, java.lang.Boolean tokenize, java.lang.Boolean mandatory, java.lang.Boolean security) throws IllegalRuleException
type - the typename - the namevalueType - the value typedefaultValue - the default valuetokenize - whether to tokenizemandatory - whether or not this item is mandatorysecurity - whether or not this item requires security inputIllegalRuleException - if an illegal rule is foundpublic static Token makeReferenceToken(java.lang.String bean, java.lang.String template, java.lang.String parameter, java.lang.String attribute, java.lang.String property)
bean - the bean idtemplate - the template idparameter - the parameter nameattribute - the attribute nameproperty - the property namepublic static java.util.Iterator<Token[]> tokenIterator(ItemRule itemRule)
Token iterator.itemRule - the item rulepublic static ItemRuleMap toItemRuleMap(java.util.List<ItemParameters> itemParametersList) throws IllegalRuleException
ItemRuleMap.itemParametersList - the item parameters list to convertIllegalRuleException - if an illegal rule is foundpublic static ItemRuleList toItemRuleList(java.util.List<ItemParameters> itemParametersList) throws IllegalRuleException
ItemRuleList.itemParametersList - the item parameters list to convertIllegalRuleException - if an illegal rule is foundpublic static ItemRule toItemRule(ItemParameters itemParameters) throws IllegalRuleException
ItemRule.
[
{
type: "map"
name: "property1"
value: {
code1: "value1"
code2: "value2"
}
valueType: "java.lang.String"
defaultValue: "default value"
tokenize: true
}
{
name: "property2"
value(int): 123
}
{
name: "property2"
reference: {
bean: "a.bean"
}
}
]
itemParameters - the item parametersItemRuleIllegalRuleException - if an illegal rule is foundpublic static java.util.List<ItemParameters> toItemParametersList(java.lang.String text)
String into an Item Parameters.text - the String to convertpublic static ItemRuleMap toItemRuleMap(java.lang.String text) throws IllegalRuleException
String into an ItemRuleMap.text - the String to convertItemRuleMapIllegalRuleException - if an illegal rule is foundCopyright © 2008–2018 The Aspectran Project. All rights reserved.