[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3092) add convenience methods on Expressions

Dan Allen (JIRA) jira-events at lists.jboss.org
Mon Jun 9 20:48:48 EDT 2008


add convenience methods on Expressions
--------------------------------------

                 Key: JBSEAM-3092
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-3092
             Project: Seam
          Issue Type: Feature Request
          Components: Core
    Affects Versions: 2.1.0.A1
            Reporter: Dan Allen
         Assigned To: Dan Allen
            Priority: Minor
             Fix For: 2.1.0.BETA1


For how often EL is needed, it sure would be nice to make it a little easier to evaluate from Java code. I propose the folllwing three methods on Expressions (which come from BaseSeamTest):

/**
 * Call a method binding
 */
public Object invokeMethod(String methodExpression) {
   return createMethodExpression(methodExpression).invoke();
}

/**
 * Evaluate (get) a value binding
 */
public Object getValue(String valueExpression) {
   return createValueExpression(valueExpression).getValue();
}

/**
 * Set a value binding
 */
public void setValue(String valueExpression, Object value) {
   createValueExpression(valueExpression).setValue(value);
}

You could even make the case for them being static:

public static Object invokeMethod(String methodExpression) {
   return Expressions.instance().createMethodExpression(methodExpression).invoke();
}

public static Object getValue(String valueExpression) {
   return Expressions.instance().createValueExpression(valueExpression).getValue();
}

public static void setValue(String valueExpression, Object value) {
   Expressions.instance().createValueExpression(valueExpression).setValue(value);
}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list