Dashboard > OGNL > Home > Pseudo Properties For Collection
  OGNL Log In View a printable version of the current page.  
  Pseudo Properties For Collection
Added by tm_jee, last edited by tm_jee on Dec 21, 2007  (view change)
Labels: 
(None)

There are some special properties of collections that OGNL makes available. The reason for this is that the collections do not follow JavaBeans patterns for method naming; therefore the size(), length(), etc. methods must be called instead of more intuitively referring to these as properties. OGNL corrects this by exposing certain pseudo-properties as if they were built-in.

Collection Special Properties
Collection (inherited by Map, List & Set) size
The size of the collection
isEmpty
Evaluates to true if the collection is empty
List iterator
Evalutes to an Iterator over the List.
Map keys
Evalutes to a Set of all keys in the Map.
values
Evaluates to a Collection of all values in the Map.

These properties, plus size and isEmpty, are different than the indexed form of access for Maps (i.e. someMap["size"] gets the "size" key from the map, whereas someMap.size gets the size of the Map.

Set iterator
Evaluates to an Iterator over the Set.
Iterator next
Evalutes to the next object from the Iterator.
hasNext
Evaluates to true if there is a next object available from the Iterator.
Enumeration next
Evalutes to the next object from the Enumeration.
hasNext
Evaluates to true if there is a next object available from the Enumeration.
nextElement
Synonym for next.
hasMoreElements
Synonym for hasNext.

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators