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  import java.util.Map;
19  
20  /***
21   * Holds a Map of variables which are referenced in a JEXL expression.
22   *
23   *  @since 1.0
24   *  @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
25   *  @version $Id: JexlContext.java 397092 2006-04-26 05:11:28Z dion $
26   */
27  public interface JexlContext {
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 
35       *      of this Map
36       */
37      void setVars(Map vars);
38      
39      /***
40       * Retrives the Map of variables associated with this JexlContext.  The
41       * keys of this map correspond to variable names referenced in a
42       * JEXL expression.
43       * 
44       * @return A reference to the variable Map associated with this JexlContext.
45       */
46      Map getVars();
47  }