Pattern Matching Syntax
In parameter definitions, the adapter supports using the pattern matching syntax defined by the java.text.MessageFormat
class specification. By referencing a pattern in an input or output parameter definition, you can convert the input data to various types and formats.
For more information on java.text.MessageFormat
, see:
http://java.sun.com/products/jdk/1.1/docs/api/java.text.MessageFormat.html
Patterns are applied using argument placeholders, which have the following form:
{number
, [type
], [format
] }
The curly brackets and number
argument are required. The number
argument can be from 0 to 9.
The type
argument is optional, and indicates the argument data type. It can be one of time
, date
, number
, or choice
.
The format
argument is also optional, and is a string that describes the argument format. Possible format values depend on the specified type. For more information on possible values for format, see the Java API documentation for the ChoiceFormat
, DateFormat
and NumberFormat
classes.
You specify the argument placeholder in the pattern
attribute of the inputParameter or
outputParameter
element. Normally, the first argument placeholder in the pattern is used and the others are ignored. However, if the subsequent input or output parameters have the pattern attribute equal to " "
(blank) then the {1}, {2}, ....{n}
of the previous one parameter with non-blank pattern attribute will be applied to the subsequent parameters in order.
Text |
Pattern |
Result (Argument {0}) |
|
{0,number}KB |
256 |
|
{1}({0,number}%) |
5 |
|
{1):{0}-{2} |
smiles |
Todays’s date is 02-02-1996 |
Todays’s date is {0,date}
|
A |