[jboss-cvs] jboss-seam/src/main/org/jboss/seam ...
Gavin King
gavin.king at jboss.com
Tue Oct 3 13:16:44 EDT 2006
User: gavin
Date: 06/10/03 13:16:44
Modified: src/main/org/jboss/seam Component.java
Log:
abstract JSF valuebindings / expressionbindings
Revision Changes Path
1.171 +9 -14 jboss-seam/src/main/org/jboss/seam/Component.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Component.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/Component.java,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -b -r1.170 -r1.171
--- Component.java 1 Oct 2006 16:56:54 -0000 1.170
+++ Component.java 3 Oct 2006 17:16:44 -0000 1.171
@@ -41,10 +41,6 @@
import javax.ejb.PrePassivate;
import javax.ejb.Remote;
import javax.ejb.Remove;
-import javax.faces.application.Application;
-import javax.faces.context.FacesContext;
-import javax.faces.el.MethodBinding;
-import javax.faces.el.ValueBinding;
import javax.interceptor.Interceptors;
import javax.servlet.http.HttpSessionActivationListener;
@@ -73,8 +69,11 @@
import org.jboss.seam.contexts.Context;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Events;
+import org.jboss.seam.core.Expressions;
import org.jboss.seam.core.Init;
import org.jboss.seam.core.ResourceBundle;
+import org.jboss.seam.core.Expressions.MethodBinding;
+import org.jboss.seam.core.Expressions.ValueBinding;
import org.jboss.seam.databinding.DataBinder;
import org.jboss.seam.databinding.DataSelector;
import org.jboss.seam.interceptors.BijectionInterceptor;
@@ -106,7 +105,7 @@
*
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
* @author Gavin King
- * @version $Revision: 1.170 $
+ * @version $Revision: 1.171 $
*/
@Scope(ScopeType.APPLICATION)
public class Component
@@ -1466,7 +1465,7 @@
Init.FactoryMethodBinding methodBinding = init.getFactoryMethodBinding(name);
if (methodBinding!=null) //let the XML take precedence
{
- Object result = methodBinding.methodBinding.invoke( FacesContext.getCurrentInstance(), null );
+ Object result = methodBinding.methodBinding.invoke(null);
return handleFactoryMethodResult(name, null, result, factoryMethod.scope);
}
else if (factoryMethod!=null)
@@ -1630,9 +1629,7 @@
{
log.debug("trying to inject with EL expression: " + name);
}
- FacesContext facesCtx = FacesContext.getCurrentInstance();
- Application application = facesCtx.getApplication();
- result = application.createValueBinding(name).getValue(facesCtx);
+ result = Expressions.instance().createValueBinding(name).getValue();
}
else if ( in.scope()==UNSPECIFIED )
{
@@ -1800,7 +1797,7 @@
}
else
{
- value = createValueBinding().getValue( FacesContext.getCurrentInstance() );
+ value = createValueBinding().getValue();
}
if (converter!=null && value instanceof String)
@@ -1819,14 +1816,12 @@
private ValueBinding createValueBinding()
{
- return FacesContext.getCurrentInstance().getApplication()
- .createValueBinding( expression );
+ return Expressions.instance().createValueBinding(expression);
}
private MethodBinding createMethodBinding()
{
- return FacesContext.getCurrentInstance().getApplication()
- .createMethodBinding( expression, null );
+ return Expressions.instance().createMethodBinding(expression);
}
public String toString()
More information about the jboss-cvs-commits
mailing list