コード例 #1
0
 static final int evalInt(ValueExpression expr, FacesContext context) {
   try {
     return (Integer) expr.getValue(context.getELContext());
   } catch (ELException e) {
     throw new FacesException(e);
   }
 }
コード例 #2
0
 static final String evalString(ValueExpression expr, FacesContext context) {
   try {
     return (String) expr.getValue(context.getELContext());
   } catch (ELException e) {
     throw new FacesException(e);
   }
 }
コード例 #3
0
  static final boolean evalBoolean(ValueExpression expr, FacesContext context) {
    try {
      Object value = expr.getValue(context.getELContext());

      if (value == null) return false;
      else if (value instanceof Boolean) return ((Boolean) value).booleanValue();
      else if (value instanceof String) return "true".equalsIgnoreCase((String) value);
      else return false;
    } catch (ELException e) {
      throw new FacesException(e);
    }
  }