From: <[EMAIL PROTECTED]>
> Hi Folks,
>
> I'm trying to reproduce how the BeanElement class works.

BeanElement allows a JavaBean to be used as the container of the attributes
of an XML element. So the attribute-related methods will get and set the
attribute values from the bean. If (say) a particular bean class name were
bound to a QName then the BeanDocumentFactory could be used to implement a
similar feature as Digester in the Jakarta Commons project.


> Consider I have a a instanced JavaBean and want to marshall it using
dom4j's
> inbuild Bean Support.
> If I use BeanElement#setData( Object o )  all the internal attribute list
> will be resettet using setAttributeList( null );
> Why?

Its an implementation detail. It means that the attribute list will get
lazily created again next time someone asks for an attribute. I've added a
comment to the code for future reference.


> It seems the API is not bidirectornal, isn't it?
> If that is true I have to marshall it handy using JavaBeans Introspection.
> Unmarshalling seems to work fine.

Certainly a BeanElement can be output as XML text or piped into a DOM or SAX
or XSLT. Also a parser can create BeanElement - so I guess you could call it
bidirectional. Though its not really intended to be a general purpose XML
<-> bean integration framework, its more of a hybrid, allowing beans and XML
to be used together.

Maybe something like JAXB might be more appropriate for your requirements?

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to