commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Ashworth" <>
Subject [Digester] Passing arguments to constructors
Date Tue, 14 Jan 2003 13:50:14 GMT

I just started using Digester yesterday and it has already saved me a lot of
time.  However, there is one thing which I haven't been able to figure out
how to do that is making up for the time I saved.  I have a condition under
which a certain object should not be created from the XML.  I am reading in
menu contents from an XML file and I want to make the menu dynamic based on
the user's permissions, known only at runtime.  I could easily do this if I
could just pass the permissions into the constructor when a new object is
created or, alternatively, when setNext is called.  That way I can determine
at runtime whether or not the object should be saved or ignored, based on
whether or not the user has appropriate permissions.  Right now what I have
to do is create the entire object then parse through it and prune the
branches that shouldn't exist, which as you could imagine takes a lot of
time.  Are there any provisions for doing what I'm trying to do with
Digester?  If not, does anybody else think this would be worthwhile enough
that I could implement the feature in Digester?

Thanks much,


View raw message