Package org.apache.commons.el

Examples of org.apache.commons.el.ExpressionEvaluatorImpl.evaluate()


      Map options) throws ELException {
    expression = JSFELParserHelper.toJspElExpression(expression);
    ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl();
    FunctionMapper mapper = new EmptyFunctionMapper();

    return evaluator.evaluate(expression, expectedClass, resolver, mapper);
  }

  class SimpleVariableResolver implements VariableResolver {
    /*
     * (non-Javadoc)
 
View Full Code Here


  public void handle(String data, ContentHandler handler) {
    ExpressionEvaluator evaluator = new ExpressionEvaluatorImpl();
    Object value;

    try {
      value = evaluator.evaluate(data, Object.class, resolver, mapper);

      if (value != null) {
        char[] result = value.toString().toCharArray();
        handler.characters(result, 0, result.length);
      } else {
View Full Code Here

            if ((uriText.getText().length() == 0) && !editingDefault) {
                throw ValidationException.required(uriText, "Please enter a URL.");
            }
            ExpressionEvaluator eval = new ExpressionEvaluatorImpl();
            try {
                eval.evaluate((String) nameText.getText(), String.class, new DefaultVariables(),
                              StaticFunctionMapper.getDefault());
            } catch (Exception e) {
                throw ValidationException.invalid(nameText, "Error evaluating EL expression:\n" + e.getMessage());
            }
            try {
View Full Code Here

                              StaticFunctionMapper.getDefault());
            } catch (Exception e) {
                throw ValidationException.invalid(nameText, "Error evaluating EL expression:\n" + e.getMessage());
            }
            try {
                eval.evaluate((String) uriText.getText(), String.class, new DefaultVariables(),
                              StaticFunctionMapper.getDefault());
            } catch (Exception e) {
                throw ValidationException.invalid(uriText, "Error evaluating EL expression:\n" + e.getMessage());
            }
View Full Code Here

    public void actionPerformed(ActionEvent ev) {
      try {
        StaticFunctionMapper functionMapper = StaticFunctionMapper.getDefault();
        ExpressionEvaluator eval = new ExpressionEvaluatorImpl();
        VariableResolver resolver = new DefaultVariables(uriText.getText(), null, null);
        resultText.setText((String) eval.evaluate(elText.getText(), String.class, resolver, functionMapper));
      } catch (ELException e) {
        ExceptionDialog.show(TestingTool.this, e);
      }
    }
  }
View Full Code Here

  // JavaDoc inherited
  public void handle(String data, ContentHandler handler) {
    ExpressionEvaluator evaluator = new ExpressionEvaluatorImpl();
    Object value;
    try {
      value = evaluator.evaluate(data, Object.class, resolver, mapper);
      if (value != null) {
        char[] result = value.toString().toCharArray();
        handler.characters(result, 0, result.length);
      } else {
        log.debug("Failed to resolve " + data);
View Full Code Here

    // JavaDoc inherited
    public void handle(String data, ContentHandler handler) {
        ExpressionEvaluator evaluator = new ExpressionEvaluatorImpl();
        Object value;
        try {
            value = evaluator.evaluate(data, Object.class, resolver, mapper);
            char[] result = value.toString().toCharArray();
            handler.characters(result, 0, result.length);
        } catch (ELException ele) {
            log.error("Failed to handle EL expression.", ele);
        } catch (SAXException saxe) {
View Full Code Here

  public void handle(String data, ContentHandler handler) {
    ExpressionEvaluator evaluator = new ExpressionEvaluatorImpl();
    Object value;

    try {
      value = evaluator.evaluate(data, Object.class, resolver, mapper);

      if (value != null) {
        char[] result = value.toString().toCharArray();
        handler.characters(result, 0, result.length);
      } else {
View Full Code Here

      retType = java.lang.String.class;
    }
    ExpressionEvaluatorImpl exprEvaluator = new ExpressionEvaluatorImpl();
    VariableResolver varResolver = ctx.getVariableResolver();
    try {
      value = exprEvaluator.evaluate(expr, retType, varResolver, null);
    } catch (javax.servlet.jsp.el.ELException e) {
      MessageFormat msgFormat = new MessageFormat(ERR_BAD_EXPR);
          log.warn(msgFormat.format(new Object[] {e.getMessage()}));
      return null;
    } // end of try-catch
View Full Code Here

  public void handle(String data, ContentHandler handler) {
    ExpressionEvaluator evaluator = new ExpressionEvaluatorImpl();
    Object              value;

    try {
      value                       = evaluator.evaluate(data, Object.class, resolver, mapper);

      if (value != null) {
        char[] result = value.toString().toCharArray();
        handler.characters(result, 0, result.length);
      } else {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.