commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bradley M. Handy" <bha...@arbor.edu>
Subject RE: Bean Utils - Generating XML for a DynaBean
Date Thu, 20 Feb 2003 13:01:11 GMT
Here are two classes I wrote.  The first (XMLDynaClass) is initialized
with an XML file.  The second (XMLDynaBean) does exactly what you would
specified in your request.  It handles nested data structures as well.
See the javadocs for details.

The two classes can be used separately from each other, so if you have
your own DynaClass implementation you can still use XMLDynaBean.  And,
if you have your own DynaBean implementations you can still use
XMLDynaClass.

Brad Handy

-----Original Message-----
From: Natalie Ng [mailto:nng1119@hotmail.com] 
Sent: Wednesday, February 19, 2003 7:00 PM
To: commons-user@jakarta.apache.org
Subject: Bean Utils - Generating XML for a DynaBean

Hi everyone, is there a simple way to generate an XML for the actual
content 
of a DynaBean instance?

i.e.

<myBean>
   <name>Snoopy</name>
</myBean>

... not the following (generated by betwixt) ...

<myBean>
  <dynaClass>
    <dynaProperties>
      <DynaProperty>
        <mapped>false</mapped>
        <name>name</name>
        <type>class java.lang.String</type>
        <indexed>false</indexed>
      </DynaProperty>
    </dynaProperties>
  </dynaClass>
</myBean>

I could probably write my own implementation with JDom, but this seems
to be 
generic enough that someone may have done already. Thanks.

cheers,
Natalie


_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*  
http://join.msn.com/?page=features/virus


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message