Skip to main content
This revision made December 05, 2011 20:05, by Kin-man Chung
« earlier revision revert to this later revision »

Collection Construction

The syntax for construction of collection objects follows the syntax that has been proposed for JDK 8 Collection literals. Note that EL 3.0 allows any expressions in the construction, and is not limited to literals.

List

Syntax: [1, "two", 3.0] Implemented with java.util.ArrayList

Set

Syntax: {1, 2, 3} Implemented with java.util.HashSet (LinkedHasSet?)

Map

Syntax: {"one": 1, "two": 2, "three": 3} Implemented with java.util.HasMap

There is no syntax for construction of Java arrays. In most cases, List can be used instead. The method List.toArray() can be used to convert a List to an array, when needed.

 
 
Close
loading
Please Confirm
Close