Class TokenizerType

java.lang.Object
org.oddjob.values.types.TokenizerType
All Implemented Interfaces:
ArooaValue

public class TokenizerType extends Object implements 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>
  • Field Details

  • Constructor Details

    • TokenizerType

      public TokenizerType()
  • Method Details

    • parse

      public String[] parse() throws ParseException
      Throws:
      ParseException
    • getDelimiter

      public String getDelimiter()
    • setDelimiter

      public void setDelimiter(String delimiter)
    • isRegexp

      public boolean isRegexp()
    • setRegexp

      public void setRegexp(boolean regexp)
    • getEscape

      public Character getEscape()
    • setEscape

      public void setEscape(Character escape)
    • getQuote

      public Character getQuote()
    • setQuote

      public void setQuote(Character quote)
    • getText

      public String getText()
    • setText

      public void setText(String text)