Transformer (extension point)
From BioUML platform
Revision as of 17:55, 13 May 2013 by Tagir Valeev (Talk | contribs)
- 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 inputClass CDATA #REQUIRED outputClass CDATA #REQUIRED transformerClass CDATA #REQUIRED >
- 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 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.