You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by di...@apache.org on 2004/08/23 03:09:55 UTC

cvs commit: jakarta-commons/jexl/xdocs/reference examples.xml

dion        2004/08/22 18:09:55

  Modified:    jexl/xdocs/reference examples.xml
  Log:
  Bit more on evaluating expressions and some other topics that need to be covered.
  
  Revision  Changes    Path
  1.2       +33 -1     jakarta-commons/jexl/xdocs/reference/examples.xml
  
  Index: examples.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jexl/xdocs/reference/examples.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- examples.xml	19 Aug 2004 17:17:52 -0000	1.1
  +++ examples.xml	23 Aug 2004 01:09:55 -0000	1.2
  @@ -21,7 +21,39 @@
     </properties>
   
     <body>
  -    <section name="Examples">
  +    <section name="Overview">
  +      <p>
  +        <ul>
  +          <li><a href="#Evaluating Expressions">Evaluating Expressions</a></li>
  +          <li><a href="#Custom Contexts">Custom Contexts</a></li>
  +          <li><a href="#Custom Resolvers">Custom Resolvers</a></li>
  +        </ul>
  +      </p>
  +    </section>
  +    <section name="Evaluating Expressions">
  +      <p>
  +        To evaluate expressions using JEXL, you need two things:
  +        <ul>
  +          <li>A <a href="http://jakarta.apache.org/commons/jexl/apidocs/org/apache/commons/jexl/JexlContext.html">context</a> containing any variables, and</li>
  +          <li>An <a href="http://jakarta.apache.org/commons/jexl/apidocs/org/apache/commons/jexl/Expression.html">expression</a></li>
  +        </ul>
  +      </p>
  +      <p>
  +        The easiest way of obtaining a a context is to use the
  +        <a href="http://jakarta.apache.org/commons/jexl/apidocs/org/apache/commons/jexl/JexlHelper.html#createContext()">JexlHelper.createContext()</a>
  +        method. This creates a context which is simply an extension of a
  +        <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/HashMap.html">HashMap</a>
  +      </p>
  +      <p>
  +        <a href="http://jakarta.apache.org/commons/jexl/apidocs/org/apache/commons/jexl/Expression.html">Expressions</a> are
  +        created using the <a href="http://jakarta.apache.org/commons/jexl/apidocs/org/apache/commons/jexl/ExpressionFactory.html#createExpression(java.lang.String)">ExpressionFactory.createExpression(String)</a>
  +        method. 
  +      </p>
  +      <p>
  +        Once you have your expression, you can then use use the
  +        <a href="http://jakarta.apache.org/commons/jexl/apidocs/org/apache/commons/jexl/Expression.html#evaluate(org.apache.commons.jexl.JexlContext)">evaluate</a>
  +        to execute it and obtain a result.
  +      </p>
       </section>
     </body>
   </document>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org