static String getAttrValue(Component component, String key) { Object value = component.getAttributes().get(key); if (value == null) { ValueExpression expr = component.getBindings().get(key); if (expr != null) { value = expr.getValue(new EvaluationContext(FacesContext.getCurrentInstance().getELContext(), null, null)); } } if (value != null) { return value.toString(); } return null; }
static String getAttrValue(Component component, String key) { Object value = component.getAttributes().get(key); if (value == null) { ValueExpression expr = component.getBindings().get(key); if (expr != null) { value = expr.getValue(new EvaluationContext(FacesContext.getCurrentInstance().getELContext(), null, null)); } } if (value != null) { return value.toString(); } return null; }
public void setValue(ELContext context, Object value) throws PropertyNotFoundException, PropertyNotWritableException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); this.getNode().setValue(ctx, value); }
public Class getType(ELContext context) throws PropertyNotFoundException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); return this.getNode().getType(ctx); }
public boolean isReadOnly(ELContext context) throws PropertyNotFoundException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); return this.getNode().isReadOnly(ctx); }
public boolean isReadOnly(ELContext context) throws PropertyNotFoundException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); return this.getNode().isReadOnly(ctx); }
public void setValue(ELContext context, Object value) throws PropertyNotFoundException, PropertyNotWritableException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); this.getNode().setValue(ctx, value); }
public void setValue(ELContext context, Object value) throws PropertyNotFoundException, PropertyNotWritableException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); this.getNode().setValue(ctx, value); }
public Class<?> getType(ELContext context) throws PropertyNotFoundException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); return this.getNode().getType(ctx); }
public boolean isReadOnly(ELContext context) throws PropertyNotFoundException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); return this.getNode().isReadOnly(ctx); }
public Class<?> getType(ELContext context) throws PropertyNotFoundException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); return this.getNode().getType(ctx); }
static String getValue(UIComponent component) { return (String) ExpressionBuilder.createNode(component.getChildren().get(0).toString()) .getValue(new EvaluationContext(FacesContext.getCurrentInstance().getELContext(), null, null)); }
static String getValue(UIComponent component) { return (String) ExpressionBuilder.createNode(component.getChildren().get(0).toString()) .getValue(new EvaluationContext(FacesContext.getCurrentInstance().getELContext(), null, null)); }
protected Object evaluateExpression(String value) { return ExpressionBuilder.createNode(value) .getValue(new EvaluationContext(FacesContext.getCurrentInstance().getELContext(), null, null)); }
protected Object evaluateExpression(String value) { return ExpressionBuilder.createNode(value) .getValue(new EvaluationContext(FacesContext.getCurrentInstance().getELContext(), null, null)); }
public Object getValue(ELContext context) throws PropertyNotFoundException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); Object value = this.getNode().getValue(ctx); if (this.expectedType != null) { return ELSupport.coerceToType(value, this.expectedType); } return value; }
public Object getValue(ELContext context) throws PropertyNotFoundException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); Object value = this.getNode().getValue(ctx); if (this.expectedType != null) { return ELSupport.coerceToType(value, this.expectedType); } return value; }
public Object getValue(ELContext context) throws PropertyNotFoundException, ELException { EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); Object value = this.getNode().getValue(ctx); if (this.expectedType != null) { return ELSupport.coerceToType(value, this.expectedType); } return value; }
/** * Evaluates the expression relative to the provided context, and returns * information about the actual referenced method. * * @param context * The context of this evaluation * @return an instance of <code>MethodInfo</code> containing information * about the method the expression evaluated to. * @throws NullPointerException * if context is <code>null</code> or the base object is * <code>null</code> on the last resolution. * @throws PropertyNotFoundException * if one of the property resolutions failed because a specified * variable or property does not exist or is not readable. * @throws MethodNotFoundException * if no suitable method can be found. * @throws ELException * if an exception was thrown while performing property or * variable resolution. The thrown exception must be included as * the cause property of this exception, if available. * @see javax.el.MethodExpression#getMethodInfo(javax.el.ELContext) */ public MethodInfo getMethodInfo(ELContext context) throws PropertyNotFoundException, MethodNotFoundException, ELException { Node n = this.getNode(); EvaluationContext ctx = new EvaluationContext(context, this.fnMapper, this.varMapper); return n.getMethodInfo(ctx, this.paramTypes); }
/** * Wrap the base ELContext, adding Seam's FunctionMapper. * * Thus, any expressions with s:hasRole, s:hasPermission * must be evaluated either via Facelets/JSP (since they * are declared in the tld/taglib.xml or via the * Expressions component. * * @param context the JSF ELContext */ private static EvaluationContext decorateELContext(ELContext context) { return new EvaluationContext( context, new SeamFunctionMapper( context.getFunctionMapper() ), context.getVariableMapper() ); }