-
transmorph 1.0.0 released : Another Object Conversion Framework (6 messages)
- Posted by: C??dric Chabanois
- Posted on: January 21 2009 09:11 EST
Transmorph is a new free java library (Apache 2 License) used to convert a Java object of one type into an object of another type (with another signature, possibly parameterized). Transmorph strong points are : * support conversion for primitives and objects * support conversion to multidimensional arrays * support conversion to parameterized collections and types * jars for JDK 1.4 and JDK 1.5 * no dependencies * easy to add more converters * can convert to a type given either its java type (Class) or signature Once configured, you can do the following conversions, for example : // int[] to a List List listOfInts = (List) converter.convert(new int[] { 0, 1, 2, 3, 4, 5 }, List.class, new Class[] { Integer.class }); // Map<String,String[]> to a Map Map> converted = (Map>) converter.convert(map, "Ljava/util/Map<Ljava/lang/String;Ljava/util/List<Ljava/lang/String;>;>;"); // int[] => LinkedList (ArrayToListConverter) LinkedList linkedList = (LinkedList) converter.convert( new int[] { 0, 1, 2, 3, 4, 5 }, LinkedList.class, new Class[] { Integer.class }); // int[][] => String[][] (ArrayToArrayConverter) int[][] arrayOfArrayOfInts = new int[][] { { 11, 12, 13 }, { 21, 22, 23 }, { 31 } }; String[][] arrayOfArrayOfStrings = (String[][]) converter.convert(arrayOfArrayOfInts, (new String[0][0]).getClass()); See some more samplesThreaded Messages (6)
- So it a Dozer-like tool ? by David MARTIN on January 21 2009 11:00 EST
- Re: So it a Dozer-like tool ? by James Watson on January 21 2009 11:36 EST
- Re: So it a Dozer-like tool ? by C??dric Chabanois on January 22 2009 09:14 EST
- makale thcxn aq by icq full on May 26 2009 07:50 EDT
- Re: transmorph 1.0.0 released : Another Object Conversion Framework by Tal Dega on January 22 2009 03:01 EST
- Solution looking for a problem by Eugene Lucash on January 22 2009 06:33 EST
-
So it a Dozer-like tool ?[ Go to top ]
- Posted by: David MARTIN
- Posted on: January 21 2009 11:00 EST
- in response to C??dric Chabanois
It sounds to be a dozer challenger. How is it different from Dozer ? What are the pros and cons ? -
Re: So it a Dozer-like tool ?[ Go to top ]
- Posted by: James Watson
- Posted on: January 21 2009 11:36 EST
- in response to David MARTIN
It sounds to be a dozer challenger.
Definitely two pros are that it's intuitive and the resulting code is extremely readable. It's also will increase your LOC over the naive solution and therefore your productivity. I can't see any cons to this at all.
How is it different from Dozer ?
What are the pros and cons ? -
Re: So it a Dozer-like tool ?[ Go to top ]
- Posted by: C??dric Chabanois
- Posted on: January 22 2009 09:14 EST
- in response to David MARTIN
Transmorph is quite different from dozer. You will use dozer to convert from a bean to another bean (typically to create a data transfer object). If it is what you want to do, Dozer will probably be a better choice than transmorph. Transmorph is more generic and will be used to convert from any object to any other object (if corresponding converters exist and have been configured). Bean To Bean is only one of the many cases. There is not even yet a generic BeanToBean converter in Transmorph (although there will be a BeanToBean converter in next version that will be released soon). -
makale thcxn aq[ Go to top ]
- Posted by: icq full
- Posted on: May 26 2009 07:50 EDT
- in response to David MARTIN
thnx for the post.. best regards; porno izle -
Re: transmorph 1.0.0 released : Another Object Conversion Framework[ Go to top ]
- Posted by: Tal Dega
- Posted on: January 22 2009 03:01 EST
- in response to C??dric Chabanois
wow looks like fun -
Solution looking for a problem[ Go to top ]
- Posted by: Eugene Lucash
- Posted on: January 22 2009 06:33 EST
- in response to C??dric Chabanois
Solution looking for a problem conversion as verbose as explicit conversion does no justify adding dependency to code on such lib