A data decoder converts data (encoded in a String) to an Object of some form, determined by
the decoder implementation.
There are a number of pre-installed decoders in the
package. DataDecoders are used in a numkber of places in Smooks:
- Component configuration value decoding.
- JavaBean Cartridge. Used to decode the binding value.
Smooks can automatically select an appropriate DataDecoder for a given purpose (via the
factory class) if the decoder is:
- Annotated with the
- Specified in the "/META-INF/data-decoders.inf" file on the classpath. Obviously this file can
exist on any number of classpath URIs. If defining custom decoders, just add the
"/META-INF/data-decoders.inf" file to your .jar file (or somewhere on the classpath). Smooks will
find all such files on the classpath.
Note how all the decoders in this package follow a well defined naming pattern of "type
where type is the Java datatype to which the implementation decodes.