Typed data elements represent business objects such as Date, ProductNumber,
and Money. They differ from non-typed data elements because they contain
information about the type of business objects they represent and
conform to the object's business rules. For example, a typed data
element identifies how the toolkit displays the business object it
represents and it also identifies what validation must occur when
the toolkit changes an attribute value. To hold this information,
typed data elements have one or more property descriptors. Non-typed
data elements do not have a property descriptor.
You can work with both typed and non-typed data elements as they
can co-exist at runtime. This means you can design and implement the
data required for a service or process using the appropriate data
elements (typed or non-typed). The only difference in runtime is that
with non-typed data elements, the getDescriptor method returns null
and with typed data elements, the getDescriptor method returns an
object implementing the PropertyDescription interface. Once you have
the property descriptor, you can use it to validate, format, unformat
or clone the typed data element.
The following diagram shows the classes used to implement typed
data elements and their relationships:

In WebSphere® Multichannel
Bank Transformation Toolkit version 7.0, or earlier, a typed data
infrastructure was provided with sample typed data elements. The sample
typed data elements had the following problems:
- The sample typed data elements were too simple and could not be
used “out of the box” in any project. This meant that new typed data
elements had to be defined by extending the abstract type hierarchy.
- When extending from the default abstract type classes (validators
and converters), complex methods had to be implemented for every subclass.
This made extending and using typed data elements very complex.
In WebSphere Multichannel
Bank Transformation Toolkit version 7.1, the problems with the sample
typed data elements in version 7.0 and earlier versions have been
resolved. The WebSphere Multichannel
Bank Transformation Toolkit version 7.1 typed data elements have the
following features:
- A set of ready-to-use typed data elements are provided as part
of the WebSphere Multichannel
Bank Transformation Toolkit code base, not just as samples.
- The extension mechanism has been simplified to ease the creation
of new typed data elements.
Note that when you edit data definitions, if the data
field has an associated type, the following requirements must be met
when providing type-related parameters:
- Each type parameter must have a description that can be read easily
by the parameter editor. The parameter description provided below
can be used as a starting point for this descriptive text, but also
some examples can be added to further clarify what you are expected
to provide.
- The parameter editor should accommodate to the type of the value
being provided. For example, a type parameter of integer type should
be validated for a correct integer input value, and boolean type parameters
should present either a checkbox or a two-value choice combo.
WebSphere Multichannel
Bank Transformation Toolkit provides the following four typed data
elements by default:
The default typed data elements extend
BasicType.
BasicType
BasicType
is the base type from which all other types extend. It is also the
new recommended type to be used for extending custom, project-specific
types.
- Descriptor
- ImplClass : com.ibm.btt.base.types.impl.BasePropertyDescriptor
- Converter
- ImplClass : com.ibm.btt.base.types.impl.BaseConverter
- Validator
- ImplClass : com.ibm.btt.base.types.impl.BaseValidator
- isMandatory (boolean)
- If true, the end user must provide a value to the data field managed
by this type before submitting any request. All subclasses of this
type support the isMandatory parameter.
String
The String
type extends from BasicType and is used for general string-based input.
- Descriptor
- ImplClass : com.ibm.btt.base.types.impl.SimplePropertyDescriptor
- Converter
- ImplClass : com.ibm.btt.base.types.impl.StringConverter
- Validator
- ImplClass : com.ibm.btt.base.types.impl.StringValidator
- minimumLength (int)
- Is the minimum length of characters for an input of this type
to be valid.
- maximumLength (int)
- Is the maximum length of characters for an input of this type
to be valid.
- regExp (string)
- Is a regular expression string that is used to match the input
string for validation. For example, the regExp="\d{10}" regular
expression will validate whether the input string is 10 numbers.
Date
The Date type
extends from BasicType and is used for date input.
- Descriptor
- ImplClass : com.ibm.btt.base.types.impl.SimplePropertyDescriptor
- Converter
- ImplClass : com.ibm.btt.base.types.impl.DateConverter
- pattern (String)
- Pattern to be used when formatting and validating input. The default
pattern is yyyy-MM-dd.
- Validator
- ImplClass : com.ibm.btt.base.types.impl.DateValidator
- minimumDate (String)
- Is the lower limit of the date value input. Supported formats:
yyyy-MM-dd. Example: 2010-03-27. today+*y*m*d. Examples: today, today
+ 2y, today + 2m + 2d, etc. today-*y*m*d. Examples: today, today -
3y, today - 5d
- maximumDate (String)
- Is the lower limit of the date value input. The format is the
same as the minimumDate parameter.
Number
The Number
type extends from BasicType, and is used for input and output of numeric
data.
- Descriptor
- ImplClass : com.ibm.btt.base.types.impl.SimplePropertyDescriptor
- Converter
- ImplClass : com.ibm.btt.base.types.impl.NumberConverter
- numberType (fixed list of choices)
- Is an enumerated value with one of the following types: byte,
short, integer, long, double, float or bigDecimal. The default value
is bigDecimal.
- pattern (String)
- Is the pattern used to format the number. If no value is specified,
the default behavior is to use the locale-specific formatting. The
pattern formate follows java number, for example: #,0000
- decimalPlaces (int, mandatory if numberType is not a scalar type)
- Is the length of the decimal part of the number. It overrides
the setting of number pattern. For example: 4 represent there are
4 number after the decimal points.
- Validator
- ImplClass : com.ibm.btt.base.types.impl.NumberValidator
- minimumNumber (same type specified in numberType)
- Is the lower limit for valid data of this type.
- maximumNumber (same type specified in numberType)
- Is the upper limit for valid data of this type.
CurrencyNumber
The
CurrencyNumber type extends from Number and is used for input and
output of money amounts.
- Descriptor
- ImplClass : com.ibm.btt.base.types.impl.SimplePropertyDescriptor
- Convertor
- ImplClass : com.ibm.btt.base.types.impl.CurrencyConverter
- numberType (fixed list of choices)
- Is an enumerated value with one of the following types: byte,
short, integer, long, double, float or bigDecimal. The default value
is bigDecimal.
- pattern (String)
- Is the pattern used to format the number. If no value is specified,
the default behavior is to use the locale-specific formatting. It
is same to the number type.
- decimalPlaces (int, mandatory if numberType is not a scalar type)
- Is the length of the decimal part of the number. It overrides
the setting of number pattern. It is same to the number type.
- currency (String)
- One currency setting to assign a type for the currency. For example:
USD represents U.S. Dollars, CNY represents Chinese yuan
- Validator
- ImplClass : com.ibm.btt.base.types.impl.CurrencyValidator
- minimumNumber (same type specified in numberType)
- Is the lower limit for valid data of this type.
- maximumNumber (same type specified in numberType)
- Is the upper limit for valid data of this type.