General

Why another project for Object conversion ?

When working on Json-lib's ability to transform a JSON String back into a java bean, I needed support for multidimensional arrays. Of all the projects mentioned on the front page, none of the provided that feature.

[top]

No really, why ?

Inspecting each ot the projects mentioned on the front page gives the following:

  • Commons-Convert will focus on Object->String->Object conversions, there is no mention of arrays and it is not even released.
  • Commons-Lang's ArrayUtils only supports array conversions from primitive types to wrappers and back, and only one dimensional arrays.
  • Commons-Beanutils's ConvertUtils only supports conversions of String->Object and one dimensional arrays.
  • Lorentz does not seem to support multidimensional arrays.
  • Morph ditto.
  • Spring's PropertyEditors work very similar to ConvertUtils, from String->Object and Object->String.
  • Dozer supports type conversion but it seems to do it only in the context of a bean and its properties, not just on a single property.


Besides Lorentz and Morph have a broader scope, EZMorph is used to transform data in a very straightforward manner (i.e, no transitional conversions under the covers).

[top]

How do I create my own Morpher ?

You'll probably want to create an ObjectMorpher and perhaps provide a default value when an excepcional cause occurs, if so you may extend AbstractObjectMorpher , if not then implement ObjectMorpher right away. Be careful when implementing your Morpher and follow the contracts of morpsTo() and supports( Class ) . If done improperly, the MorpherRegistry and the ArrayMorphers would probaly handle your Morpher incorrectly.

[top]

Why the cheesy logo ?

My GIMP-fu is very rusty. I'm open to suggestions. =-)

[top]

Where can I get the code for the source code syntax highlighter ?

The SintaxHighlighter is availabe from Alex Gorbatchev at http://www.dreamprojections.com/SyntaxHighlighter .

[top]