Package com.caucho.el

Examples of com.caucho.el.ELParser


  }

  public static String evalString(String string, ELContext env)
    throws ELException
  {
    Expr expr = new ELParser(env, string).parse();

    return expr.evalString(env);
  }
View Full Code Here


  public void init()
    throws ConfigException
  {
    if (_format != null) {
      try {
        ELParser elParser = new ELParser(new ConfigELContext(), _format);
       
        _expr = elParser.parse();
      } catch (Exception ex) {
        throw ConfigException.create(ex);
      }
    }
  }
View Full Code Here

   * Converts the string to a value of the type.
   */
  @Override
  public Object valueOf(String text)
  {
    ELParser parser = new ELParser(getELContext(), text);
    parser.setCheckEscape(true);
    Expr expr = parser.parse();
   
    return expr;
  }
View Full Code Here

    if (env == null)
      env = Config.getEnvironment();

    string = rewritePathString(string);

    Expr expr = new ELParser(env, string).parse();

    Object obj = expr.evalObject(env);

    if (obj == null)
      throw new NullPointerException(L.l("Path '{0}' evaluated to null.",
View Full Code Here

  private Object eval(ConfigType<?> type, String data)
  {
    ELContext elContext = getELContext();

    ELParser parser = new ELParser(elContext, data);

    Expr expr = parser.parse();

    Object value = type.valueOf(elContext, expr);
   
    if (value != null)
      return value;
View Full Code Here

   */
  private Object evalObject(String exprString)
    throws ELException
  {
    if (exprString.indexOf("${") >= 0 && isEL()) {
      ELParser parser = new ELParser(getELContext(), exprString);
      parser.setCheckEscape(true);
      Expr expr = parser.parse();

      return expr.getValue(getELContext());
    }
    else
      return exprString;
View Full Code Here

    if (env == null)
      env = Config.getEnvironment();
   
    string = rewritePathString(string);

    Expr expr = new ELParser(env, string).parse();

    Object obj = expr.evalObject(env);

    if (obj instanceof Path)
      return (Path) obj;
View Full Code Here

  }

  public static String evalString(String string, ELContext env)
    throws ELException
  {
    Expr expr = new ELParser(env, string).parse();

    return expr.evalString(env);
  }
View Full Code Here

TOP

Related Classes of com.caucho.el.ELParser

Copyright © 2018 www.massapicom. 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.