Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Text<->Java Bean Object transformation

Reply
Thread Tools

Text<->Java Bean Object transformation

 
 
Edmond wong
Guest
Posts: n/a
 
      04-14-2005
Hi,

I am looking for a mapping tool to convert text to javabean object map,
and javabean object map to text, but I don't need to care about the
format of the text as long as it is not xml.

Thanks,

Edmond
 
Reply With Quote
 
 
 
 
Oscar kind
Guest
Posts: n/a
 
      04-14-2005
Edmond wong <(E-Mail Removed)> wrote:
> I am looking for a mapping tool to convert text to javabean object map,
> and javabean object map to text, but I don't need to care about the
> format of the text as long as it is not xml.


I'm not certain what you mean by "javabean object map", but let's assume
you mean the name-value pairs that are the properties of the javabean (and
their values).

Then, find another name-value representation; java.util.Properties --
which restricts the names and values to String objects, so make sure you
can handle the conversions.

Using the Jakarta beanutils library, you can get a Map with all name-value
pairs using org.apache.commons.beanutils.BeanUtilsBean#describ e(Object).
Then use java.util.Properties#putAll(Map) and
java.util.Properties#store(OutputStream,String) to store the name-value
pairs into a properties file.


--
Oscar Kind http://home.hccnet.nl/okind/
Software Developer for contact information, see website

PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modelling an object as Session Bean or Entity Bean ? Francesco Java 3 12-07-2006 04:22 PM
[ejb][jboss]Bean inside a serialized object in another bean carlg@libertybasic.com Java 1 09-13-2006 08:10 PM
Differnce between Java Bean and Enterprise Java Bean Markku Salminen Java 3 01-21-2004 09:25 AM
can a session bean return a local entity bean object? David Thielen Java 2 09-12-2003 07:45 AM
To bean or not to bean... Benjamin Stewart Java 0 06-30-2003 12:34 AM



Advertisments