Package org.oddjob.values.types
Class TokenizerType
java.lang.Object
org.oddjob.values.types.TokenizerType
- All Implemented Interfaces:
ArooaValue
- Author:
- rob
Description
Tokenizes text. This type provides conversion to an array or list of strings.
The delimiter can be provided as either plain text or a regular expression.
The default delimiter is the regular expression \s*,\s* which is
CSV with optional white space either side.
Example
Tokenize comma separated values.
<oddjob>
<job>
<foreach preLoad="7" purgeAfter="3">
<values>
<tokenizer text="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12"/>
</values>
<configuration>
<xml>
<foreach id="test">
<job>
<echo name="Echo ${test.current}">I'm ${test.current}</echo>
</job>
</foreach>
</xml>
</configuration>
</foreach>
</job>
</oddjob>
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
ELEMENT
-
DEFAULT_DELIMITER_REGEXP
- See Also:
-
-
Constructor Details
-
TokenizerType
public TokenizerType()
-
-
Method Details
-
parse
- Throws:
ParseException
-
getDelimiter
-
setDelimiter
-
isRegexp
public boolean isRegexp() -
setRegexp
public void setRegexp(boolean regexp) -
getEscape
-
setEscape
-
getQuote
-
setQuote
-
getText
-
setText
-