Text<->Java Bean Object transformation

E

Edmond wong

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
 
O

Oscar kind

Edmond wong said:
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#describe(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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top