Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Java 1 5 Support"

 
Line 16: Line 16:
  
 
In both cases we should be able to validate these issues.
 
In both cases we should be able to validate these issues.
 +
 +
 +
=Generics=

Revision as of 18:17, 29 September 2006

Overview

Unified EL adds support for Java 5. Java 5 enumerations are directly supported as types in EL expressions. Java 5 generics cannot be used directly, but symbols can now typed using generics, so symbol and type resolution is now affected.


Enumerations

The following is an example of enumeration use in an EL expression:

#{myColor == 'blue'}

Let's say that myColor resolves to an instance of a Java enumeration Color. EL will attempt to coerce 'blue' to a enumeration value the Color type in order to make the comparison. This creates several possible validation opportunities:

  • is 'blue' coerciable to an Enumeration? If not, the JSF runtime may throw an exception.
  • is Enum.valueOf(Color.class, 'blue') a valid value? If 'blue' is not a valid value for Color, this will cause an IllegalArgumentException at runtime.

In both cases we should be able to validate these issues.


Generics

Back to the top