stringTokens

Parses a string into tokens and iterates over its content for each token.

This tag tokenizes strings using the Java StringTokenizer class. See the javadoc for Stringokenizer for more information on how to describe the parsing.

The stringTokens tag will parse the given string into tokens using the specified delimiter characters. For each token, a temporary model node will be created with attributes describing the token: "value" (the token), "delimiter" (the trailing delimiter that ended the token. If the delimitedBy attribute was omitted then this value will be an empty string), "first" (a true/false value indicating whether this is the first token), "last" (a true/false value indicating whether this is the last token) and "index" (the zero-based index of this token). Once the temporary model node describing the current token is built, that node is associated with the variable name specified in the name attribute and the contents of the stringTokens tag is processed once.


Tag Summary
 
required <stringTokens string="value" name="value" />
 
full tag <stringTokens string="value" delimitedBy="value" name="value" delimiter="value" reverse="value" tokenLength="value" />

Required Attributes
 
string The string to be parsed
name The variable name to be associated with the temporary model nodes describing the tokens. Nested tags can use this variable name to refer to the temporary node.

Optional Attributes
 
delimitedBy The tokens that delimit the tokens in the string
delimiter The string to write after every iteration except the last
reverse A true/false value indicating whether the tokens should be iterated over first-to-last (false) or last-to-first (true)
tokenLength Default description for attribute tokenLength

Example
 
<stringTokens
        string="com.ibm.issw.jdbc"
        delimitedBy="."
        name="current"
        delimiter="/"
        reverse="true"
        tokenLength="An integer that, if specified, will cause the string to be parsed into strings of this length, ignoring the delimitedBy attribute" ></stringTokens>

This iterate tag will write out the string "jdbc/issw/ibm/com".


© Copyright IBM Corporation 2000, 2006. All Rights Reserved.