/** * Create a method expression. * * @param expression a JBoss EL method expression */ public MethodExpression<Object> createMethodExpression(String expression) { return createMethodExpression(expression, Object.class); }
private MethodExpression createMethodExpression() { return Expressions.instance().createMethodExpression(expression); }
public MethodExpression getMethodBinding() { //TODO: figure out some way to cache this!! return Expressions.instance().createMethodExpression(expression); } public ValueExpression getValueBinding()
/** * Call a method binding */ protected Object invokeMethod(String methodExpression) { return Expressions.instance().createMethodExpression(methodExpression).invoke(); }
/** * Add a new listener for a given event type * * @param type the event type * @param methodBindingExpression a method binding, expressed in EL * @param argTypes the argument types of the method binding */ public void addListener(String type, String methodBindingExpression, Class... argTypes) { MethodExpression methodBinding = Expressions.instance().createMethodExpression(methodBindingExpression, Object.class, argTypes); Init.instance().addObserverMethodExpression(type, methodBinding); }
String expression = SafeActions.toAction(actionId); result = true; MethodExpression actionExpression = Expressions.instance().createMethodExpression(expression); outcome = toString( actionExpression.invoke() ); fromAction = expression;
private static Action parseAction(Element element, String actionAtt, boolean conditionalsAllowed) { Action action = new Action(); String methodExpression = element.attributeValue(actionAtt); if (methodExpression==null) return null; if ( methodExpression.startsWith("#{") ) { action.setMethodExpression( Expressions.instance().createMethodExpression(methodExpression) ); } else { action.setOutcome(methodExpression); } if (conditionalsAllowed) { String expression = element.attributeValue("if"); if (expression!=null) { action.setValueExpression( Expressions.instance().createValueExpression(expression) ); } action.setOnPostback(!"false".equals(element.attributeValue("on-postback"))); } return action; }
failedAuthenticationUrl = serviceProvider.getFailedAuthenticationUrl(); internalAuthenticationMethod = Expressions.instance().createMethodExpression( serviceProvider.getInternalAuthenticationMethod(), Boolean.class, Principal.class, List.class);
init.addObserverMethodExpression( listenerDescriptor.getType(), Expressions.instance().createMethodExpression(expression) );