View Javadoc

    1   /*
    2    * Copyright 2002,2004 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  import java.util.Map;
    19
    20  /***
    21   * Holds a Map of variables which are referenced in a JEXL expression.
    22   *
    23   *  @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
    24   *  @version $Id: JexlContext.java,v 1.6 2004/08/23 13:53:34 dion Exp $
    25   */
    26  public interface JexlContext
    27  {
    28      /***
    29       * Replaces variables in a JexlContext with the variables contained
    30       * in the supplied Map.  When setVars() is called on a JexlContext,
    31       * it clears the current Map and puts each entry of the
    32       * supplied Map into the current variable Map.
    33       *
    34       * @param vars Contents of vars will be replaced with the content of this Map
    35       */
    36      void setVars(Map vars);
    37
    38      /***
    39       * Retrives the Map of variables associated with this JexlContext.  The
    40       * keys of this map correspond to variable names referenced in a
    41       * JEXL expression.
    42       *
    43       * @return A reference to the variable Map associated with this JexlContext.
    44       */
    45      Map getVars();
    46  }