> > 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
      introspector.introspect(A.class);
      ElementDescriptor fooPropertyDesciptor =
registry.get(A.class).getElementDescriptor().getElementDescriptors()[0];
      fooPropertyDesciptor.setWrapCollectionsInElement(false);
      // Init a object and write it
      A a = new A();
      .......
      beanWriter.write(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"/>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to