EL Variable Support

From Eclipsepedia

Jump to: navigation, search

Background

Here is an example of the use of an EL variable:

   <c:forEach var="book" items="\#\{BooksBean.books\}">
	<h:inputText id="quantity" value="\#\{book.quantity\}" ... />
   </c:forEach>

The fragment shows a c:forEach creating a variable called "book" whose value is the expression "#{BooksBean.books}". When h:inputText evaluates "book" in its value attribute, the correct instance is evaluated based on the instance of BooksBean.books that was selected for that collection on a particular iteration of the forEach.

In order to support symbols like book at design-time we need to create a new type of symbol called IExpressionVariableInstanceSymbol.

Expression Instance Symbol

Here is the class hierarchy for the new Expression Instance Symbol:

ExpressionVariableInstanceSymbol.png


Notice that this defines IExpressionVariableInstanceSymbol as a specialization of an IInstanceSymbol, meaning that it is a kind of instance symbol like a managed bean or resource bundle.