Transformation Metatype Converters
Identifier:
com.ibm.xtools.transform.core.metatypeConverters
Since:
Transformation component - version 7.0
Description:
This extension defines a metatype converter which allows new metatypes to be
defined and used by transformations and their properties.
A metatype converter provides the following functionality for
a given type of data object:
- represent a data object as a persistable string that can be resolved
- optionally adapt a selection object into the data object it represents
- optionally represent a data object as a user editable string that can be resolved
Once a metatype converter is defined, the metatype can be used as the underlying type for
transformation properties or can be used as the source and target model types for a
transformation. When used as the type for a transformation property, the value of that
property will be an applicable data object instead of a string. When used for source
and target model types, the metatype converter must support adaptation of the
selection into a data object.
Configuration Markup:
<!ELEMENT extension (MetatypeConverter+)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
A standard Eclipse extension for defining metatype converters. The "point" attribute must be set as
com.ibm.xtools.transform.core.metatypeConverters
.
- point - Value must be "com.ibm.xtools.transform.core.metatypeConverters".
- id - A unique identifier for this extension (not used).
- name - A name for this extension (not used).
<!ELEMENT MetatypeConverter EMPTY>
<!ATTLIST MetatypeConverter
id CDATA #REQUIRED
metatype CDATA #REQUIRED
description CDATA #IMPLIED
typeClass CDATA #REQUIRED
class CDATA #REQUIRED
canAdaptSelection (true | false) "false"
hasEditableString (true | false) "false">
This extension entry defines one metatype converter. Multiple converters can be
defined in the same extension.
- id - Each metatype converter MUST have a unqiue identifier. This ID will be used when persisting its data objects so that the same converter can be used when the data object is to be resolved.
- metatype - The logical name of the metatype (case insensitive). This name can be used as the "metatype" attribute of transformation properties or as one of the source or
target model types for a transformation (defined in the transformation descriptor).
This metatype name should not be translated since it refers to a fundamental type such a boolean and integer.
- description - A translated short description of what this metatype is and how it can be used.
- typeClass - Defines the fully qualified name of the Java class from which all instances of the metatype
must be derived from. (e.g., Class.isInstance(dataObject) must return true).
- class - The metatype class provides the real logic for handling data object
manipulations. This class must be subclassed from AbstractMetatype.
- canAdaptSelection - This flag indicates whether the converter can adapt a selected UI object
that represents a metatype data object into that data object.
If this flag is true, then the metatype can be used as source and
target model types in a transformation descriptor.
- hasEditableString - This flag indicates whether the converter can represent a metatype
data object as a user editable string that can be resolved back into an object.
If this flag is true, then read-write transformation properties based on
this metatype will be displayed in the default properties tab of the
transformation configuration manager dialog.
Examples:
Following is an example of a metatype converter extension:
<extension point="com.ibm.xtools.transform.core.metatypeConverters">
<MetatypeConverter
id="com.ibm.xtools.transform.core.metatype.string"
metatype="string"
typeClass="java.lang.String"
class="com.ibm.xtools.transform.core.internal.metatype.converters.StringMetatype"
canAdaptSelection="true"
hasEditableString="true" />
</extension>
Supplied Implementation:
All metatype convert classes must be derived from com.ibm.xtools.transform.core.AbstractMetatype
Copyright (c) 2004, 2018 Model RealTime, HCL and others. All Rights Reserved.