[jboss-cvs] jboss-seam/src/main/org/jboss/seam/util ...
Gavin King
gavin.king at jboss.com
Thu Oct 26 15:12:39 EDT 2006
User: gavin
Date: 06/10/26 15:12:39
Added: src/main/org/jboss/seam/util UnifiedELMethodBinding.java
UnifiedELValueBinding.java
Log:
use EL outside of JSF
Revision Changes Path
1.1 date: 2006/10/26 19:12:39; author: gavin; state: Exp;jboss-seam/src/main/org/jboss/seam/util/UnifiedELMethodBinding.java
Index: UnifiedELMethodBinding.java
===================================================================
package org.jboss.seam.util;
import static org.jboss.seam.util.EL.EL_CONTEXT;
import static org.jboss.seam.util.EL.EXPRESSION_FACTORY;
import javax.el.MethodExpression;
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
import javax.faces.el.MethodBinding;
import javax.faces.el.MethodNotFoundException;
public class UnifiedELMethodBinding extends MethodBinding
{
private MethodExpression me;
public UnifiedELMethodBinding(String expression, Class[] args)
{
me = EXPRESSION_FACTORY.createMethodExpression(EL_CONTEXT, expression, Object.class, args);
}
@Override
public String getExpressionString()
{
return me.getExpressionString();
}
@Override
public Class getType(FacesContext ctx) throws MethodNotFoundException
{
return me.getMethodInfo(EL_CONTEXT).getReturnType();
}
@Override
public Object invoke(FacesContext ctx, Object[] args) throws EvaluationException, MethodNotFoundException
{
return me.invoke(EL_CONTEXT, args);
}
@Override
public String toString()
{
return me.getExpressionString();
}
}
1.1 date: 2006/10/26 19:12:39; author: gavin; state: Exp;jboss-seam/src/main/org/jboss/seam/util/UnifiedELValueBinding.java
Index: UnifiedELValueBinding.java
===================================================================
package org.jboss.seam.util;
import static org.jboss.seam.util.EL.EL_CONTEXT;
import static org.jboss.seam.util.EL.EXPRESSION_FACTORY;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
import javax.faces.el.EvaluationException;
import javax.faces.el.PropertyNotFoundException;
import javax.faces.el.ValueBinding;
public class UnifiedELValueBinding extends ValueBinding
{
private ValueExpression ve;
public UnifiedELValueBinding(String expression)
{
ve = EXPRESSION_FACTORY.createValueExpression(EL_CONTEXT, expression, Object.class);
}
@Override
public String getExpressionString()
{
return ve.getExpressionString();
}
@Override
public Class getType(FacesContext ctx) throws EvaluationException, PropertyNotFoundException {
return ve.getType(EL_CONTEXT);
}
@Override
public Object getValue(FacesContext ctx) throws EvaluationException, PropertyNotFoundException {
return ve.getValue(EL_CONTEXT);
}
@Override
public boolean isReadOnly(FacesContext ctx) throws EvaluationException, PropertyNotFoundException {
return ve.isReadOnly(EL_CONTEXT);
}
@Override
public void setValue(FacesContext ctx, Object value) throws EvaluationException, PropertyNotFoundException {
ve.setValue(EL_CONTEXT, value);
}
@Override
public String toString()
{
return ve.getExpressionString();
}
}
More information about the jboss-cvs-commits
mailing list