Author: maksimkaszynski
Date: 2008-03-07 07:16:44 -0500 (Fri, 07 Mar 2008)
New Revision: 6615
Modified:
trunk/ui/core/src/main/config/component/mediaOutput.xml
trunk/ui/core/src/main/config/component/push.xml
trunk/ui/core/src/main/java/org/ajax4jsf/component/ResourceBundleMap.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIActionParameter.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxForm.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxRegion.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxStatus.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxSupport.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPortlet.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPush.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIRepeat.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/ActionParamTag.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxRegionTag.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/ActionListenerTest.java
Log:
fixed syntax for J5
Modified: trunk/ui/core/src/main/config/component/mediaOutput.xml
===================================================================
--- trunk/ui/core/src/main/config/component/mediaOutput.xml 2008-03-07 12:16:28 UTC (rev
6614)
+++ trunk/ui/core/src/main/config/component/mediaOutput.xml 2008-03-07 12:16:44 UTC (rev
6615)
@@ -131,7 +131,7 @@
</property>
<property elonly="true">
<name>createContent</name>
- <classname>javax.faces.el.MethodBinding</classname>
+ <classname>javax.el.MethodExpression</classname>
<description>
<![CDATA[
Method call expression to send generated resource to OutputStream. It must have
two parameter with a type of java.io.OutputStream
Modified: trunk/ui/core/src/main/config/component/push.xml
===================================================================
--- trunk/ui/core/src/main/config/component/push.xml 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/config/component/push.xml 2008-03-07 12:16:44 UTC (rev 6615)
@@ -55,7 +55,7 @@
<name>eventProducer</name>
- <classname>javax.faces.el.MethodBinding</classname>
+ <classname>javax.el.MethodExpression</classname>
<description>
MethodBinding pointing at method accepting an PushEventListener with return
type void.
User bean must register this listener and send EventObject to this listener
on ready.
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/ResourceBundleMap.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/ResourceBundleMap.java 2008-03-07
12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/ResourceBundleMap.java 2008-03-07
12:16:44 UTC (rev 6615)
@@ -34,7 +34,7 @@
* @author shura
*
*/
-public class ResourceBundleMap implements Map {
+public class ResourceBundleMap implements Map<String, Object> {
private ResourceBundle _bundle;
@@ -95,7 +95,7 @@
/* (non-Javadoc)
* @see java.util.Map#put(java.lang.Object, java.lang.Object)
*/
- public Object put(Object arg0, Object arg1) {
+ public Object put(String arg0, Object arg1) {
throw new
UnsupportedOperationException(Messages.getMessage(Messages.BUNDLE_MAP_NO_PUT_VALUE));
}
@@ -106,12 +106,6 @@
throw new
UnsupportedOperationException(Messages.getMessage(Messages.BUNDLE_MAP_NO_REMOVE_VALUE));
}
- /* (non-Javadoc)
- * @see java.util.Map#putAll(java.util.Map)
- */
- public void putAll(Map arg0) {
- throw new
UnsupportedOperationException(Messages.getMessage(Messages.BUNDLE_MAP_NO_PUT_VALUE));
- }
/* (non-Javadoc)
* @see java.util.Map#clear()
@@ -123,7 +117,7 @@
/* (non-Javadoc)
* @see java.util.Map#keySet()
*/
- public Set keySet() {
+ public Set<String> keySet() {
// TODO Auto-generated method stub
return null;
}
@@ -131,17 +125,18 @@
/* (non-Javadoc)
* @see java.util.Map#values()
*/
- public Collection values() {
+ public Collection<Object> values() {
// TODO Auto-generated method stub
return null;
}
- /* (non-Javadoc)
- * @see java.util.Map#entrySet()
- */
- public Set entrySet() {
+ public Set<java.util.Map.Entry<String, Object>> entrySet() {
// TODO Auto-generated method stub
return null;
}
+
+ public void putAll(Map<? extends String, ? extends Object> t) {
+ throw new
UnsupportedOperationException(Messages.getMessage(Messages.BUNDLE_MAP_NO_PUT_VALUE));
+ }
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIActionParameter.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIActionParameter.java 2008-03-07
12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIActionParameter.java 2008-03-07
12:16:44 UTC (rev 6615)
@@ -21,12 +21,13 @@
package org.ajax4jsf.component;
+import javax.el.ELContext;
+import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.component.UIComponentBase;
import javax.faces.component.UIParameter;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
-import javax.faces.el.ValueBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
@@ -46,13 +47,13 @@
/***************************************************************************
* Binding for update on ActionEvent
*/
- private ValueBinding _assignToBinding = null;
+ private ValueExpression _assignToBinding = null;
- public void setAssignToBinding(ValueBinding propertyBinding) {
+ public void setAssignToBinding(ValueExpression propertyBinding) {
this._assignToBinding = propertyBinding;
}
- public ValueBinding getAssignToBinding() {
+ public ValueExpression getAssignToBinding() {
return _assignToBinding;
}
@@ -117,7 +118,7 @@
Object value = super.getValue();
// TODO - perform conversion if converter is present.
if (null != value) {
- Class type = value.getClass();
+ Class<?> type = value.getClass();
FacesContext context = getFacesContext();
Converter converter = createConverter(context, type);
if (null != converter) {
@@ -138,13 +139,14 @@
*/
public void processAction(ActionEvent actionEvent)
throws AbortProcessingException {
- FacesContext context = FacesContext.getCurrentInstance();
- ValueBinding updateBinding = getAssignToBinding();
- if (updateBinding != null && (!updateBinding.isReadOnly(context))) {
+ FacesContext context = getFacesContext();
+ ELContext elContext = context.getELContext();
+ ValueExpression updateBinding = getAssignToBinding();
+ if (updateBinding != null && (!updateBinding.isReadOnly(elContext))) {
Object requestValue = context.getExternalContext()
.getRequestParameterMap().get(getName());
if (requestValue != null && requestValue instanceof String) {
- Class type = updateBinding.getType(context);
+ Class<?> type = updateBinding.getType(elContext);
Converter converter = createConverter(context, type);
if (null != converter) {
requestValue = converter.getAsObject(context, this,
@@ -153,7 +155,7 @@
}
}
if (null != requestValue) {
- updateBinding.setValue(context, requestValue);
+ updateBinding.setValue(elContext, requestValue);
}
}
@@ -165,7 +167,7 @@
* @return
* @throws FacesException
*/
- private Converter createConverter(FacesContext context, Class type)
+ private Converter createConverter(FacesContext context, Class<?> type)
throws FacesException {
Converter converter = getConverter();
if (converter == null && type != null && !type.equals(String.class)
@@ -189,7 +191,7 @@
Object values[] = (Object[]) state;
super.restoreState(context, values[0]);
// restore fields values
- _assignToBinding = (ValueBinding) UIComponentBase.restoreAttachedState(
+ _assignToBinding = (ValueExpression) UIComponentBase.restoreAttachedState(
context, values[1]);
_noEscape = (Boolean) values[2];
_converter = (Converter) UIComponentBase.restoreAttachedState(context,
@@ -225,9 +227,11 @@
if (null != field) {
return field.booleanValue();
}
- ValueBinding vb = getValueBinding(name);
+ ValueExpression vb = getValueExpression(name);
if (null != vb) {
- return ((Boolean) vb.getValue(getFacesContext())).booleanValue();
+ FacesContext context = getFacesContext();
+ ELContext elContext = context.getELContext();
+ return ((Boolean) vb.getValue(elContext)).booleanValue();
} else {
return false;
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxForm.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxForm.java 2008-03-07 12:16:28
UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxForm.java 2008-03-07 12:16:44
UTC (rev 6615)
@@ -57,7 +57,7 @@
decode(context);
if (mustProcessed(context))
{
- for (Iterator it = getFacetsAndChildren(); it.hasNext();)
+ for (Iterator<UIComponent> it = getFacetsAndChildren(); it.hasNext();)
{
UIComponent childOrFacet = (UIComponent) it.next();
childOrFacet.processDecodes(context);
@@ -74,7 +74,7 @@
if (context == null) throw new NullPointerException("context");
if (mustProcessed(context))
{
- for (Iterator it = getFacetsAndChildren(); it.hasNext();)
+ for (Iterator<UIComponent> it = getFacetsAndChildren(); it.hasNext();)
{
UIComponent childOrFacet = (UIComponent) it.next();
childOrFacet.processValidators(context);
@@ -92,7 +92,7 @@
if (context == null) throw new NullPointerException("context");
if (mustProcessed(context))
{
- for (Iterator it = getFacetsAndChildren(); it.hasNext();)
+ for (Iterator<UIComponent> it = getFacetsAndChildren(); it.hasNext();)
{
UIComponent childOrFacet = (UIComponent) it.next();
childOrFacet.processUpdates(context);
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxRegion.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxRegion.java 2008-03-07
12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxRegion.java 2008-03-07
12:16:44 UTC (rev 6615)
@@ -23,12 +23,12 @@
import java.io.IOException;
+import javax.el.MethodExpression;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIPanel;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
-import javax.faces.el.MethodBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
@@ -129,7 +129,7 @@
*
* @see org.ajax4jsf.framework.ajax.AjaxViewBrige#getAjaxListener()
*/
- public MethodBinding getAjaxListener() {
+ public MethodExpression getAjaxListener() {
return brige.getAjaxListener();
}
@@ -180,7 +180,7 @@
*
* @see
org.ajax4jsf.framework.ajax.AjaxViewBrige#setAjaxListener(javax.faces.el.MethodBinding)
*/
- public void setAjaxListener(MethodBinding ajaxListener) {
+ public void setAjaxListener(MethodExpression ajaxListener) {
brige.setAjaxListener(ajaxListener);
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxStatus.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxStatus.java 2008-03-07
12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxStatus.java 2008-03-07
12:16:44 UTC (rev 6615)
@@ -23,11 +23,12 @@
import java.io.Serializable;
+import javax.el.ELContext;
+import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
import org.ajax4jsf.Messages;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
@@ -349,9 +350,9 @@
if( null != field){
return field;
}
- ValueBinding vb = getValueBinding(name);
+ ValueExpression vb = getValueExpression(name);
if (null != vb) {
- return vb.getValue(getFacesContext());
+ return vb.getValue(getELContext());
} else {
return null;
}
@@ -367,13 +368,16 @@
if( fieldSet ){
return field;
}
- ValueBinding vb = getValueBinding(name);
+ ValueExpression vb = getValueExpression(name);
if (null != vb) {
- return ((Boolean)vb.getValue(getFacesContext())).booleanValue();
+ return ((Boolean)vb.getValue(getELContext())).booleanValue();
} else {
return false;
}
}
+ private ELContext getELContext() {
+ return getFacesContext().getELContext();
+ }
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxSupport.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxSupport.java 2008-03-07
12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxSupport.java 2008-03-07
12:16:44 UTC (rev 6615)
@@ -21,10 +21,10 @@
package org.ajax4jsf.component;
+import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
import org.ajax4jsf.Messages;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
@@ -67,27 +67,22 @@
*/
public abstract void setOnsubmit(String newOnsubmit);
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIComponentBase#setValueBinding(java.lang.String,
- * javax.faces.el.ValueBinding)
- */
- public void setValueBinding(String arg0, ValueBinding arg1) {
+ @Override
+ public void setValueExpression(String name, ValueExpression binding) {
// var - not allowed name. must be literal.
- if ("var".equals(arg0)) {
+ if ("var".equals(name)) {
throw new FacesException(Messages.getMessage(
Messages.VAR_MUST_BE_LITERAL,
getClientId(getFacesContext())));
}
- if ("event".equals(arg0)) {
+ if ("event".equals(name)) {
throw new FacesException(Messages.getMessage(
Messages.EVENT_MUST_BE_LITERAL,
getClientId(getFacesContext())));
}
- super.setValueBinding(arg0, arg1);
+ super.setValueExpression(name, binding);
}
-
+
/**
* Create Special <code>ValueBinding</code> for build JavaScrept event
* code in parent component from this.
@@ -95,12 +90,12 @@
* @return <code>EventValueBinding</code> based on properties of current
* component
*/
- private ValueBinding getEventValueBinding() {
+ private ValueExpression getEventValueBinding() {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(Messages.CREATE_JAVASCRIPT_EVENT,
getId()));
}
- return new EventValueBinding(this);
+ return new EventValueExpression(this);
}
/**
@@ -165,7 +160,7 @@
}
public void setParentProperties(UIComponent parent) {
- ValueBinding valueBinding;
+ ValueExpression valueBinding;
if (null != getEvent()) {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(
@@ -174,7 +169,7 @@
// for non action/data components, or for non-default events - build
// listener for this instance.
valueBinding = getEventValueBinding();
- parent.setValueBinding(getEvent(), valueBinding);
+ parent.setValueExpression(getEvent(), valueBinding);
}
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java 2008-03-07 12:16:28
UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java 2008-03-07 12:16:44
UTC (rev 6615)
@@ -21,11 +21,12 @@
package org.ajax4jsf.component;
+import javax.el.ELContext;
+import javax.el.ValueExpression;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
@@ -67,11 +68,11 @@
* viewId for included page. Setter for viewId @param viewId - new value
*/
public void setViewId(String __viewId) {
- ValueBinding vb = getValueBinding("viewId");
- FacesContext facesContext = getFacesContext();
- if (null != vb && (!vb.isReadOnly(facesContext))) {
+ ValueExpression vb = getValueExpression("viewId");
+ ELContext elContext = getELContext();
+ if (null != vb && (!vb.isReadOnly(elContext))) {
// Change value of viewId in backed bean, if possible.
- vb.setValue(facesContext, __viewId);
+ vb.setValue(elContext, __viewId);
} else {
this._viewId = __viewId;
}
@@ -85,9 +86,9 @@
if (null != this._viewId) {
return this._viewId;
}
- ValueBinding vb = getValueBinding("viewId");
+ ValueExpression vb = getValueExpression("viewId");
if (null != vb) {
- return (String) vb.getValue(getFacesContext());
+ return (String) vb.getValue(getELContext());
} else {
return null;
}
@@ -102,9 +103,9 @@
if (null != this._layout) {
return this._layout;
}
- ValueBinding vb = getValueBinding("layout");
+ ValueExpression vb = getValueExpression("layout");
if (null != vb) {
- return (String) vb.getValue(getFacesContext());
+ return (String) vb.getValue(getELContext());
} else {
return null;
}
@@ -232,6 +233,11 @@
// }
}
+ private ELContext getELContext() {
+ return getFacesContext().getELContext();
+ }
+
+ @SuppressWarnings("serial")
private static class EventWrapper extends FacesEvent {
private FacesEvent wrapped;
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPortlet.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPortlet.java 2008-03-07 12:16:28
UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPortlet.java 2008-03-07 12:16:44
UTC (rev 6615)
@@ -3,8 +3,6 @@
*/
package org.ajax4jsf.component;
-import java.lang.reflect.Method;
-
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
@@ -18,6 +16,7 @@
*/
public class UIPortlet extends UIComponentBase implements NamingContainer {
+
private static final Log _log = LogFactory.getLog(UIPortlet.class);
/**
* <p>The standard component type for this component.</p>
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPush.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPush.java 2008-03-07 12:16:28 UTC
(rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPush.java 2008-03-07 12:16:44 UTC
(rev 6615)
@@ -23,9 +23,9 @@
import java.io.IOException;
+import javax.el.MethodExpression;
import javax.faces.component.NamingContainer;
import javax.faces.context.FacesContext;
-import javax.faces.el.MethodBinding;
import javax.servlet.http.HttpSession;
import org.ajax4jsf.webapp.PollEventsManager;
@@ -51,10 +51,10 @@
}
public void encodeBegin(FacesContext context) throws IOException {
- MethodBinding producer = getEventProducer();
+ MethodExpression producer = getEventProducer();
// Subscribe events producer to push status listener.
if(null != producer){
- producer.invoke(context, new Object[]{getListener(context)});
+ producer.invoke(context.getELContext(), new Object[]{getListener(context)});
}
super.encodeBegin(context);
}
@@ -83,9 +83,9 @@
_submitted = submitted;
}
- public abstract MethodBinding getEventProducer();
+ public abstract MethodExpression getEventProducer();
- public abstract void setEventProducer(MethodBinding producer);
+ public abstract void setEventProducer(MethodExpression producer);
/**
* @return time in mc for polling interval.
*/
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIRepeat.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIRepeat.java 2008-03-07 12:16:28
UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIRepeat.java 2008-03-07 12:16:44
UTC (rev 6615)
@@ -23,7 +23,9 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
/**
* @author shura
*
@@ -33,7 +35,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#dataChildren()
*/
- protected Iterator dataChildren() {
+ protected Iterator<UIComponent> dataChildren() {
// TODO Auto-generated method stub
return getChildren().iterator();
}
@@ -41,7 +43,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#fixedChildren()
*/
- protected Iterator fixedChildren() {
+ protected Iterator<UIComponent> fixedChildren() {
// TODO Auto-generated method stub
return getFacets().values().iterator();
}
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java
===================================================================
---
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java 2008-03-07
12:16:28 UTC (rev 6614)
+++
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java 2008-03-07
12:16:44 UTC (rev 6615)
@@ -31,7 +31,6 @@
import org.ajax4jsf.component.UIActionParameter;
import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.LegacyValueBinding;
import com.sun.facelets.tag.MetaRule;
import com.sun.facelets.tag.MetaRuleset;
import com.sun.facelets.tag.Metadata;
@@ -115,9 +114,8 @@
}
public void applyMetadata(FaceletContext ctx, Object instance) {
- ((UIActionParameter) instance).setAssignToBinding(
- new LegacyValueBinding(attr.getValueExpression(ctx,
- Object.class)));
+ ((UIActionParameter)
instance).setAssignToBinding(attr.getValueExpression(ctx,
+ Object.class));
}
}
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java
===================================================================
---
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java 2008-03-07
12:16:28 UTC (rev 6614)
+++
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java 2008-03-07
12:16:44 UTC (rev 6615)
@@ -26,7 +26,6 @@
import org.ajax4jsf.component.UIMediaOutput;
import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.LegacyMethodBinding;
import com.sun.facelets.tag.MetaRule;
import com.sun.facelets.tag.MetaRuleset;
import com.sun.facelets.tag.Metadata;
@@ -96,7 +95,7 @@
*/
static class MMediaActionMapper extends Metadata {
- private static final Class[] MMEDIA_ACTION_SIG = new Class[]
{OutputStream.class,Object.class};
+ private static final Class<?>[] MMEDIA_ACTION_SIG = new Class[]
{OutputStream.class,Object.class};
private final TagAttribute _send;
/**
@@ -111,9 +110,8 @@
*/
public void applyMetadata(FaceletContext ctx, Object instance) {
((UIMediaOutput) instance)
- .setCreateContent(new LegacyMethodBinding(this._send
- .getMethodExpression(ctx, null,
- MMEDIA_ACTION_SIG)));
+ .setCreateContent(this._send.getMethodExpression(ctx, null,
+ MMEDIA_ACTION_SIG));
}
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/ActionParamTag.java
===================================================================
---
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/ActionParamTag.java 2008-03-07
12:16:28 UTC (rev 6614)
+++
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/ActionParamTag.java 2008-03-07
12:16:44 UTC (rev 6615)
@@ -31,7 +31,6 @@
import org.ajax4jsf.Messages;
import org.ajax4jsf.component.UIActionParameter;
import org.ajax4jsf.webapp.taglib.UIComponentTagBase;
-import org.richfaces.webapp.taglib.ValueBindingValueExpressionAdaptor;
/**
@@ -90,7 +89,7 @@
if (_assignTo != null) {
if (_assignTo.isLiteralText()) throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_VALUE_REFERENCE_ERROR_2,
_assignTo));
UIActionParameter al = (UIActionParameter)component;
- al.setAssignToBinding(new
ValueBindingValueExpressionAdaptor(_assignTo));
+ al.setAssignToBinding(_assignTo);
if (_converter != null)
{
if (!_converter.isLiteralText()) {
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxRegionTag.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxRegionTag.java 2008-03-07
12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxRegionTag.java 2008-03-07
12:16:44 UTC (rev 6615)
@@ -30,7 +30,6 @@
import org.ajax4jsf.component.UIAjaxRegion;
import org.ajax4jsf.renderkit.html.AjaxRegionRenderer;
import org.ajax4jsf.webapp.taglib.UIComponentTagBase;
-import org.richfaces.webapp.taglib.MethodBindingMethodExpressionAdaptor;
/**
@@ -113,7 +112,7 @@
if (ajaxListener.isLiteralText()) {
getFacesContext().getExternalContext().log(Messages.getMessage(Messages.INVALID_EXPRESSION,
ajaxListener));
}
- ((AjaxContainer) component).setAjaxListener(new
MethodBindingMethodExpressionAdaptor(ajaxListener));
+ ((AjaxContainer) component).setAjaxListener(ajaxListener);
}
}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/component/ActionListenerTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/ActionListenerTest.java 2008-03-07
12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/ActionListenerTest.java 2008-03-07
12:16:44 UTC (rev 6615)
@@ -23,6 +23,9 @@
import java.io.Serializable;
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -139,7 +142,11 @@
UIActionParameter param = new UIActionParameter();
param.setConverter(new IntegerConverter());
param.setName("param");
- param.setAssignToBinding(application.createValueBinding("#{bean.first}"));
+ ELContext elContext = facesContext.getELContext();
+ ExpressionFactory expressionFactory = application.getExpressionFactory();
+ ValueExpression expression =
+ expressionFactory.createValueExpression(elContext, "#{bean.first}",
Integer.TYPE);
+ param.setAssignToBinding(expression);
Bean bean = new Bean();
request.setAttribute("bean", bean);
request.addParameter("param", "123");