I wrote an initial implementation of of an Uberspector that delegates introspection to other Uberspectors on a per-class basis, and uses the egular behavior if no alternate Uberspectors are registered. I also wrote one custom Uberpector, and so far everything seems to be working really well.

I posted the source code to http://wiki.apache.org/jakarta-velocity/MultiUberspect

Shinobu -- thanks for the help!  I have a couple of further questions:

1) What should an Iterator returned by Uberpect.getIterator() do? Iterate through properties of a class? Or is this meant to provide handle Collection-like things that don't support the Collection interface?

2) Is VelPropertyGet.getMethodName() really used anywhere (I ask because I can't really return a real method name vis-a-vis the object that can be used to return a specific property. I just want to make sure this won't mess anything up)

3) When should I declare a VelPropertyGet not cacheable?

4) Different properties in my target class are accessed via different chains of method calls. Thus far, my custom getPropertyGet instantiate one type of VelPropertyGet, whose invoke() runs a conditional on the property name to return the right value.

Would it be better to check the property name inside getPropertyGet and write more VelPropertyGet classes, returning a VelPropertyGet customized for a particular chain of method calls.

[another way of phrasing this might be 'does Velocity cache the VelPropertyGets on a per-class or per-property basis?

thanks again...hope the code is useful to someone.
eric


--------------------------------------------------------------------- Eric Fixler [EMAIL PROTECTED]


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



Reply via email to