View Javadoc

    1   /*
    2    * Copyright 2002-2006 The Apache Software Foundation.
    3    *
    4    * Licensed under the Apache License, Version 2.0 (the "License");
    5    * you may not use this file except in compliance with the License.
    6    * You may obtain a copy of the License at
    7    *
    8    *      http://www.apache.org/licenses/LICENSE-2.0
    9    *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  package org.apache.commons.jexl;
    17
    18  /***
    19   *  A Resolver allows custom resolution of the expression, and can be
    20   *  added in front of the jexl engine, or after in the evaluation.
    21   *
    22   *  @todo This needs to be explained in detail.  Why do this?
    23   *  @since 1.0
    24   *  @author <a href="mailto:geirm@adeptra.com">Geir Magnusson Jr.</a>
    25   *  @version $Id: JexlExprResolver.java 397092 2006-04-26 05:11:28Z dion $
    26   */
    27  public interface JexlExprResolver {
    28      /*** represents an expression result of no value. */
    29      Object NO_VALUE = new Object();
    30
    31      /***
    32       *  Evaluates an expression against the context.
    33       *
    34       *  @todo Must detail the expectations and effects of this resolver.
    35       *  @param context current data context
    36       *  @param expression expression to evauluate
    37       *  @return value (may be null) or the NO_VALUE object to
    38       *       indicate no resolution.
    39       */
    40      Object evaluate(JexlContext context, String expression);
    41  }