public class CmsSelectConfigurationParser
extends java.lang.Object
Use following syntax for the configuration:
value='{text}' default='{true|false}' option='{text}' help='{text}|{more option definitions}
For example:
value='value1' default='true' option='option1' help='help1'|value='value2' option='option2' help='help2'
The elements default
, option
and help
are all optional, only a
value
must be present in the input.
There should be only one default
set to true
in the input, if more than one is detected, only the first default
found is actually used.
If no option
is given, the value of option
defaults to the value of the given value
.
If no help
is given, the default is null
.
Shortcut syntax options:
If you don't specify the value
key, the value is assumed to start at the first position of an
option definition. In this case the value must not be surrounded by the '
chars.
Example: value='some value' default='true'
can also be written as some value default='true'
.
Only if you use the short value definition as described above, a default value can be marked with a *
at the end of the value definition.
Example: value='some value' default='true'
can also be written as some value*
.
Only if you use the short value definition as described above, you can also append the option
to the value
using a :
. In this case no '
must surround the option
.
Please keep in mind that in this case the value
itself can not longer contain a :
char, since it would then be interpreted as a delimiter.
Example: value='some value' option='some option'
can also be written as some value:some option
.
Any combinations of the above described shortcuts are allowed in the configuration option String. Here are some more examples of valid configuration option Strings:
1*|2|3|4|5|6|7
1 default='true'|2|3|4|5|6|7
value='1' default='true'|value='2'|value='3'
value='1'|2*|value='3'
1*:option text|2|3|4
1* option='option text' help='some'|2|3|4
构造器和说明 |
---|
CmsSelectConfigurationParser(java.lang.String configuration)
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
getDefaultValue()
Returns the default value.
|
java.util.List<java.lang.String> |
getDefaultValues()
Returns the default value.
|
java.util.Map<java.lang.String,java.lang.String> |
getHelpTexts()
Returns the help texts.
|
java.util.Map<java.lang.String,java.lang.String> |
getOptions()
Returns the options.
|
public CmsSelectConfigurationParser(java.lang.String configuration)
configuration
- the configurationpublic java.lang.String getDefaultValue()
public java.util.List<java.lang.String> getDefaultValues()
public java.util.Map<java.lang.String,java.lang.String> getHelpTexts()
public java.util.Map<java.lang.String,java.lang.String> getOptions()