Difference between revisions of "Transformer (extension point)"
From BioUML platform
Tagir Valeev (Talk | contribs) (Created page with "{{Extension point|transformer|ru.biosoft.access|registry=ru.biosoft.access.generic.TransformerRegistry}} === Description === Transformer classes should be registered if you wa...") |
Tagir Valeev (Talk | contribs) (+name) |
||
Line 6: | Line 6: | ||
<!ELEMENT transformer> | <!ELEMENT transformer> | ||
<!ATTLIST transformer | <!ATTLIST transformer | ||
+ | name CDATA #REQUIRED | ||
inputClass CDATA #REQUIRED | inputClass CDATA #REQUIRED | ||
outputClass CDATA #REQUIRED | outputClass CDATA #REQUIRED | ||
Line 11: | Line 12: | ||
> | > | ||
+ | ;name | ||
+ | :Unique human-readable name representing the title of resulting element | ||
;inputClass | ;inputClass | ||
:Fully-qualified name of input class accepted by transformer. Currently only {{Class|ru.biosoft.access.FileDataElement}} and {{Class|ru.biosoft.access.Entry}} are supported. | :Fully-qualified name of input class accepted by transformer. Currently only {{Class|ru.biosoft.access.FileDataElement}} and {{Class|ru.biosoft.access.Entry}} are supported. | ||
Line 21: | Line 24: | ||
<extension id="image file transformer" point="ru.biosoft.access.transformer"> | <extension id="image file transformer" point="ru.biosoft.access.transformer"> | ||
<transformer | <transformer | ||
+ | name="Image" | ||
inputClass="ru.biosoft.access.FileDataElement" | inputClass="ru.biosoft.access.FileDataElement" | ||
outputClass="ru.biosoft.access.ImageDataElement" | outputClass="ru.biosoft.access.ImageDataElement" |
Latest revision as of 16:04, 11 December 2014
- Identifier
- ru.biosoft.access.transformer
- Plugin
- ru.biosoft.access
- Registry
TransformerRegistry
[edit] Description
Transformer classes should be registered if you want transformed items to be compatible with GenericDataCollection
.
[edit] 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.
[edit] 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.