Transformer (extension point)
From BioUML platform
- Identifier
- ru.biosoft.access.transformer
- Plugin
- ru.biosoft.access
- Registry
TransformerRegistry
Description
Transformer classes should be registered if you want transformed items to be compatible with GenericDataCollection
.
Configuration Markup
<!ELEMENT transformer> <!ATTLIST transformer name CDATA #REQUIRED inputClass CDATA #REQUIRED outputClass CDATA #REQUIRED transformerClass CDATA #REQUIRED >
- name
- Unique human-readable name representing the title of resulting element
- inputClass
- Fully-qualified name of input class accepted by transformer. Currently only
FileDataElement
andEntry
are supported. - outputClass
- Fully-qualified name of output class accepted by transformer. Must implement
DataElement
interface. - transformerClass
- Fully-qualified name of the transformer class. Must implement
Transformer
interface.Transformer.getInputType()
must return inputClass andTransformer.getOutputType()
must return outputClass. In many cases it's easier to inheritAbstractTransformer
class.
Example
<extension id="image file transformer" point="ru.biosoft.access.transformer"> <transformer name="Image" inputClass="ru.biosoft.access.FileDataElement" outputClass="ru.biosoft.access.ImageDataElement" transformerClass="ru.biosoft.access.support.FileImageTransformer"/> </extension>
This extension allows ImageDataElement
objects to be converted to FileDataElement
and vice-versa via FileImageTransformer
. Thanks to this extension you can put ImageDataElement
objects to GenericDataCollection
collections.