You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Simon Kitching <si...@ecnetwork.co.nz> on 2003/03/06 23:02:45 UTC

Re: [digester] give Digester access to private data

On Fri, 2003-03-07 at 11:05, Erik Price wrote:
> I'm really impressed by how easily I was able to put Digester to use! 
> Within a few minutes of installing the libraries I had some working 
> code.  Thanks to the developers.
Yep. Craig, Robert et. al have done a fine job.

> 
> I was wondering if there is a way to have Digester call private methods 
> of a class.


Simple answer: it can't. Any method intended to be invoked by the
Digester must be public (protected isn't sufficient either).

Regards,

Simon


Re: [digester] give Digester access to private data

Posted by Erik Price <ep...@ptc.com>.

robert burrell donkin wrote:

> simon's right that the standard rules that ship with digester use 
> beanutils for introspection. the intention is to make introspection the 
> same as the java language access rules (obeyed by java compilers).
> 
> there actually isn't anything inherent that ties digester to this kind 
> of introspection - it's just that this is the aim of the standard rules.
> 
> IMHO the right way to approach this question would be to create new 
> rules which vary the introspection systems used. using reflection to 
> access private or protected methods can get a bit hairy - but the people 
> using these rules should know that already.
> 
> i would be happy (if there is demand) to vary the design of the basic 
> classes which use introspection, refactoring the introspection code into 
> a separate interface allowing this to be varied more easily.

I'm not familiar enough with techniques using reflection to make this 
worth your while, though that isn't to say that there aren't others who 
would benefit from it.

> you might like to take a look at the clazz project (currently in the 
> sandbox).

I will do that.

Thanks Robert,

Erik


Re: [digester] give Digester access to private data

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On Thursday, March 6, 2003, at 10:10 PM, Erik Price wrote:
> Simon Kitching wrote:
>
>> Simple answer: it can't. Any method intended to be invoked by the
>> Digester must be public (protected isn't sufficient either).
>
> Oh okay.  Thanks for the quick response.

simon's right that the standard rules that ship with digester use 
beanutils for introspection. the intention is to make introspection the 
same as the java language access rules (obeyed by java compilers).

there actually isn't anything inherent that ties digester to this kind of 
introspection - it's just that this is the aim of the standard rules.

IMHO the right way to approach this question would be to create new rules 
which vary the introspection systems used. using reflection to access 
private or protected methods can get a bit hairy - but the people using 
these rules should know that already.

i would be happy (if there is demand) to vary the design of the basic 
classes which use introspection, refactoring the introspection code into a 
separate interface allowing this to be varied more easily.

you might like to take a look at the clazz project (currently in the 
sandbox).

- robert


Re: [digester] give Digester access to private data

Posted by Erik Price <ep...@ptc.com>.

Simon Kitching wrote:

> Simple answer: it can't. Any method intended to be invoked by the
> Digester must be public (protected isn't sufficient either).

Oh okay.  Thanks for the quick response.


Erik