commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maksimenko Alexander" <>
Subject Re: [Betwixt] Composite properties
Date Mon, 17 Mar 2003 10:11:20 GMT
> > 1. How can I define wrapCollectionsInElement  for particular composite
> > property of the bean. Or in general, how can i access ElementDescriptor
> > for particular bean.
> as for the second question, you can totally replace the betwixt
> introspection system by plugging an custom XMLBeanInfoRegistry. just
> create your own class extending XMLBeanInfo which contains a description
> of you bean. then create a XMLBeanInfoRegistry which contains supplies an
> instance whenever the class is requested.
> another item on the to do list is a XMLBeanInfoRegistry which would have a
> protected set of XMLBeanInfo implementations to make this kind of thing
> much easier. i might bring this forward if you plan to go down this route.

Thank you for answer. Your suggestions helped me to write the following:
      // Init
      BeanWriter beanWriter = new BeanWriter(outputWriter);
      XMLIntrospector introspector = beanWriter.getXMLIntrospector();
      XMLBeanInfoRegistry registry = introspector.getRegistry();
      // Take ElementDesciptor object
      ElementDescriptor fooPropertyDesciptor =
      // Init a object and write it
      A a = new A();

Of course it would be nice if I had access to all properties of the Element
Descriptor in the file .betwixt:
<element name="foo" property="fooList" wrapCollectionsInElement="false"/>

View raw message