Expanding your use of EL: Mea Culpa
Fri May 02 21:27:54 EDT 2014
A while back, a wrote a couple posts about using Expression Language (EL) to clean up your XPages code, and in the first of them I gave what I labeled an exclusive list of the interfaces that XPages EL provides special support for (as opposed to just looking for getters/setters). It turns out I was sorely mistaken: there are at least two other types that EL specially supports.
The first is the class used for JavaScript objects, such as allowing #{foo.bar}
to bind like you'd expect to a value set to the JavaScript literal { bar: 'baz' }
. I'm not sure where the specific support comes in - presumably based on one of the classes in the hierarchy and not the IValue
interface it implements - but it's not terribly important.
The second is an interface that I've used frequently, but didn't realize had this property: ViewRowData
. ViewRowData
is essentially a specialized variant of DataObject
intended for view entries - so much so, in fact, that I just assumed that view entries supported DataObject
simultaneously, as my classes that implement it do.
I don't expect I'll have a lot of situations where I'll want to implement ViewRowData
but not DataObject
, but it's good to know one additional tidbit about the inner workings of XPages. One day, maybe I'll try to find a truly exhaustive list of what gets special treatment.