Activity - stringTokenizer
Activity Type: Transformation
Description
Break a single block of data into multiple blocks of data based around a character separator.
Example
<stringTokenizer name="tokenizer">
<stringBlocksInput from="CSVDataOutput"/>
<delimiters value=","/>
<stringTokensOutput name="results"/>
</stringTokenizer>
Specification
Element stringTokenizer:
- Attribute name - unique name for the activity within the scope of a request.
- Element stringBlocksInput (required) - the string data block to split.
- Attribute from - input stream providing the string which will be split into string tokens around the separator.
-
delimiters (zero or one) - string split characters.
- Attribute value - string containing the characters to be used to split the string.
- For example, ":," specifies that the string should be split upon colons and commas. The input string "To be, or not to be: that is the question:" would be split into the following tokens:
- "To be"
- "or not to be"
- "that is the question"
- If not provided then the separator defaults to space.
- Note that existing whitespace and layout in the string to be tokenized have no special significance.
-
stringTokensOutput (required) - output stream for the sub-strings.
- Attribute name - name of this output stream.
Input and Output Types
- Input: stringBlocksInput —
- java.lang.String
- byte[] - these are converted to a java.lang.String
- Any other objects are converted to a java.lang.String via java.lang.Object.toString()
- Output: stringTokensOutput — java.lang.String
Data Resource Accessor
This activity can operate with any data resource accessor.
XML Schema
OGSA-DAI/schema/ogsadai/xsd/activities/string_tokenizer.xsd
Class
uk.org.ogsadai.activity.transform.StringTokenizerActivity
Client Toolkit Class
uk.org.ogsadai.client.toolkit.activity.transform.StringTokenizerActivity