Runtime components : Core components : Typed data : Reference : Typed data element external definitions
  
Typed data element external definitions
Data elements have the following definitions externalized in the types definition file:
<type> tag attributes
id
The name of the type.
implClass
The name of the class to be instantiated when creating a data element from this type. For simple types, this is the DataField class or a subclass of it. For compound types, this class is either KeyedCollection, IndexedCollection, or a subclass of them.
keyBuilder
An optional attribute of the type tag that provides the fully qualified class name of the KeyBuilder. The key builder builds keys (unique identifiers) for business objects of this type.
<Descriptor> tag attributes
id
The name of the descriptor. This can be the name of a property within the owning type (for example, the type with id="Address" may contain a property called streetName) or it is "typeDefault" if this tag defines the default descriptor of the owning type.
implClasss
The fully qualified name of the class that implements this descriptor. If the descriptor definition does not contain this attribute, the toolkit obtains the descriptor class name from the tag name, which must be of the form xxxDescriptor. In this case the implied class name is xxx followed by PropertyDescriptor. For example, if the tag name is MoneyDescriptor, the implied class name is MoneyPropertyDescriptor. In this case, the toolkit looks for the class in each of the packages defined in the typedData keyed collection defined in the packages keyed collection of the btt.xmlfile.
refType
A reference to this descriptor's type defined elsewhere. If the definition does not include this attribute, the toolkit assumes the referred type is the enclosing type if this property descriptor has an id = "typeDefault". Otherwise, the toolkit gets the class name of the property descriptor. For example, the toolkit assumes the property descriptor with implClass packageName.MoneyPropertyDescriptor (or without implClass but with a MoneyDescriptor tag) that does not have a refType attribute refers to the Money type.
initialValue
The initial value for the data element instantiated from this descriptor's type.
description
A description for the data element instantiated from this descriptor's type.
isMandatory, isOmitted, isHidden, isReadOnly, isDisabled
Optional attributes that set status flags used to initialize the initialState attribute of the PropertyDescriptor. The default value for these attributes is false. The toolkit copies these attributes to the DataElement instance created from this descriptor's type.
param
A subtag that you can use to add one or more parameters. The <param> subtag has an id attribute that contains the name of the parameter and the value attribute contains its value.
To save memory, you can set the value of parameter "shareDataDescriptors" to "true"; by default, this value is "false". If value of this parameter is set to "false" in file btt.xml, you can not define those parameters which are already defined in "Converter" or "Validator" tags under "PropertyDescriptor" tag.
<Converter> tag attributes
convTypes
A comma-separated list of conversion types supported by this Converter.
implClass
The fully qualified name of the class that implements this converter. This class is responsible for formatting or unformatting the typed data to which it is referring. This attribute is mandatory.
param
A subtag that you can use to add one or more parameters. The <param> subtag has an id attribute that contains the name of the parameter and the value attribute contains its value.
<Validator> tag attributes
implClass
The fully qualified name of the class that implements this validator. This class is responsible for validating the typed data to which it is referring. This attribute is mandatory.
param
A subtag that you can use to add one or more parameters. The <param> subtag has an id attribute that contains the name of the parameter and the value attribute contains its value.
<parameter> tag attributes
id
The name of the parameter to be set
value
The value of the parameter
Example of typed data definitions in the types definition file
<type id="Money" implClass="com.ibm.btt.base.DataField">
<Descriptor id="typeDefault" implClass="com.ibm.btt.base.types.ext.FloatDescriptor">
<Converter convTypes="default" implClass=com.ibm.btt.base.types.ext.FloatConverter/>
<Validator implClass="com.ibm.btt.base.types.ext.FloatValidator" lowerLimit="0"/>
</Descriptor >
</kColl>
Data elements have the following definitions externalized in the data definition file:
<data> tag attributes
id
The name of the data element. This attribute is mandatory.
value
The initial value of the data element. This is an optional attribute
description
The description of the data element. This is an optional attribute
refType
A references the type of this data element defined elsewhere.
param
A subtag that you can use to add one or more parameters. The <param> subtag has an id attribute that contains the name of the parameter and the value attribute contains its value.
Example of typed data definitions in the data definition file:
<data id="myBalance" refType="Money" value="1000"
description="the balance in my account" lowerLimit="1000"/>
Go up to
Reference