Text<->Java Bean Object transformation

Discussion in 'Java' started by Edmond wong, Apr 14, 2005.

  1. Edmond wong

    Edmond wong Guest

    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
     
    Edmond wong, Apr 14, 2005
    #1
    1. Advertising

  2. Edmond wong

    Oscar kind Guest

    Edmond wong <> 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#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.


    --
    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
     
    Oscar kind, Apr 14, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Thielen
    Replies:
    2
    Views:
    809
    Marek Lange
    Sep 12, 2003
  2. Markku Salminen
    Replies:
    3
    Views:
    5,868
    Michael Borgwardt
    Jan 21, 2004
  3. jill
    Replies:
    5
    Views:
    15,702
  4. Replies:
    1
    Views:
    412
    Manish Pandit
    Sep 13, 2006
  5. Francesco
    Replies:
    3
    Views:
    488
Loading...

Share This Page