jakartaee / expression-language

Jakarta Expression Language
https://eclipse.org/ee4j/el
Other
68 stars 49 forks source link

Make it possible to be notified when resolution happens #29

Closed glassfishrobot closed 4 years ago

glassfishrobot commented 12 years ago

In fixing JAVASERVERFACES_SPEC_PUBLIC-1080, I have found it useful to be notified when an EL expression is resolved. My particular use case is when one ELResolver in the chain wants to make assertions that are impacted by the operation of other resolvers later in the chain and in the expression.

I've added this to the ELContextImpl in JSF: {{ @Override public void setPropertyResolved(boolean resolved) { if (resolved && null != resolutionListeners) { for (ResolutionListener cur : resolutionListeners)

{ cur.propertyResolved(this); }

} super.setPropertyResolved(resolved); }

private List resolutionListeners;

public void addResolutionListener(ResolutionListener l) { if (null == resolutionListeners)

{ resolutionListeners = new ArrayList(); }

resolutionListeners.add(l); }

// ----------------------------------------------------------- Inner Classes

public interface ResolutionListener

{ public void propertyResolved(ELContext ctx); }

}}

glassfishrobot commented 6 years ago
glassfishrobot commented 12 years ago

@glassfishrobot Commented Reported by @edburns

glassfishrobot commented 12 years ago

@glassfishrobot Commented Issue-Links: blocks JAVASERVERFACES_SPEC_PUBLIC-1080

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA UEL-29

markt-asf commented 4 years ago

EvaluationListener was added in EL 3.0