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