public class CustomStringListCommandParameter extends StringListCommandParameter
StringListCommandParameter
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
criteria
the (regular expression) validation criteria a given input string needs to fulfill
e.g.:
"(/?([a-zA-Z0-9])(/[a-zA-Z0-9_\\-\\.])*(.[a-z]+))"
|
private java.lang.String[] |
value
this parameters given value;
|
Constructor and Description |
---|
CustomStringListCommandParameter(java.lang.String id,
java.lang.String des)
constructor for the custom string list parameter with id and description
|
CustomStringListCommandParameter(java.lang.String id,
java.lang.String des,
java.lang.String criteria)
constructor for the custom string list parameter with id, description and criteria
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
method to clone this object for instantiation
|
java.lang.String |
getCriteria() |
java.lang.String[] |
getValue() |
CommandParameter |
instantiate(java.lang.String s)
instantiate single string
|
CommandParameter |
instantiate(java.lang.String[] s)
instantiates a list of arguments if valid
|
boolean |
isValid(java.lang.String s)
valid iff string matches criteria
|
void |
setCriteria(java.lang.String criteria) |
void |
setValue(java.lang.String[] value) |
getDescription, getIdentifier
private java.lang.String[] value
private java.lang.String criteria
public CustomStringListCommandParameter(java.lang.String id, java.lang.String des)
id
- the identification string of this parameterdes
- the description of this parameterpublic CustomStringListCommandParameter(java.lang.String id, java.lang.String des, java.lang.String criteria)
id
- the identification string of this parameterdes
- the description of this parametercriteria
- the validation criteria for this parameterpublic java.lang.String[] getValue()
getValue
in class StringListCommandParameter
public java.lang.String getCriteria()
public void setValue(java.lang.String[] value)
setValue
in class StringListCommandParameter
public void setCriteria(java.lang.String criteria)
public boolean isValid(java.lang.String s)
isValid
in class StringListCommandParameter
s
- the given input stringpublic CommandParameter instantiate(java.lang.String s)
instantiate
in class StringListCommandParameter
s
- the given string to instantiatepublic CommandParameter instantiate(java.lang.String[] s)
instantiate
in class StringListCommandParameter
s
- the given strings array to instantiatepublic java.lang.Object clone()
clone
in class StringListCommandParameter