|
Version: 3.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DataTransformerFactory
An interface defining factories (creators) of data transformers. One factory usually creates similar data transformers that differ only in the value(s) passed to their constructors.
Why to use factories, at all?
A possible scenario would be to discover (using the SPI (Service Provider Interface) discovery mechanism) directly data transformers. This, however, works best when the discovered implementations of data transformers are using empty constructors. But in the real world many data transformers will be very similar (meaning: they will be represented by the same implementing class), and they would differ only by values given to them in the non-empty constructor. And here are factories to rescue the show:
A recommended (but not mandatory) scenario would be to use SPI to
discover not data transformers but their factories. Each factory would
read some configuration file where it finds which data transformers to
create, and what values to give them in their constructors. Such
factory would then return all its data transformers using getDataTransformers() method.
| Method Summary | |
|---|---|
DataTransformer[] |
getDataTransformers()
Return all data transformers created by this factory. |
| Method Detail |
|---|
DataTransformer[] getDataTransformers()
|
Version: 3.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||