Johan Compagner wrote:
yes i currently don't have support for { or [ or things like that.
Just plain text with dots. This makes it very easy and fast to parse.
but if people really want this:

person.children[0].name

I can think of two reasons why an access operator [] could be useful:

- It might make the expression more readable, because you know that you are operating on an array, List or Map by looking at the expression.

- The content of the access operator could be an expression itself. Example:
        person.children[person.selectedChildIndex].name


But I think this is already too much functionality. I would prefer the most simple approach with only the most basic support for arrays, Lists and Maps using only dot-syntax.


There is one issue that's very important to me. I have run into this using the Expression Language of JSP 2.0:

If you have a class that implements Map, you can not access a bean property on the instance.

Let's say we have the following class:

        class Bar extends HashMap {
                public String getFoo() ...
        }

Now create an instance and populate it:

        Bar b = new Bar();
        b.put("yadda", "value");


The JSP EL Evaluator would return null for the following expression:

        b.foo


I think the Evaluator should look for a value in the map using containsKey() and look for a bean property if nothing was found. On a list, you could check if the key is numeric.

This would not be a performance hit, and you are still able to use the instance like any other object.



Timo


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to