commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Tripodi <>
Subject [digester] help on fixing DIGESTER-153
Date Mon, 14 Nov 2011 08:02:07 GMT
Hi all guys,
I'm writing to ask you all a big help on fixing that issues that is
spoling my sweet dreams and completely blocking for the rest :)

The well known issue is that the Digester has been able to create
objects using only the default empty constructor, that is because
instances are created when the XML elements begin.

Thanks to Matt Benson's effort, using CGLIB it is possible to create
instances using arbitrary constructors, extracting arguments from the
same matching XML element attributes.

I am sure we can do even more, extracting constructor arguments from
nested elements, I mean, given the following POJO:

class MyBean

  // (g|s)etter omitted
  private float floatProperty;

  public MyBean( double doubleProperty, boolean booleanProperty )

and the following XML snippet

  <bean double="9.99">

I would like - but don't know how, that's here that I need help - via
CGLIB (or something similar) implementing a Lazy Initialization policy
that allows us creating a proxy that tracks the Object methods
invocations, but the constructor and methods will be invoked only when
the matchin XML element terminates.

Just to be more clear:

  <bean double="9.99">            <!-- create the MyBean Proxy,
register the 1st ctor argument -->
    <boolean>true</boolean>     <!-- register the 2nd ctor argument -->
    <float>5.5</float>                <!-- track invokation of the
setBeanProperty -->
  </bean>                                <!-- matche ends, invoke the
constructor and tracked methods -->

Do you think that would be possible?
Many thanks in advance, all the best!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message