You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by he...@apache.org on 2016/08/12 10:39:13 UTC
svn commit: r1756139 - in /commons/proper/jexl/trunk: RELEASE-NOTES.txt
pom.xml src/main/java/org/apache/commons/jexl3/JexlContext.java
src/site/xdoc/changes.xml src/site/xdoc/reference/syntax.xml
Author: henrib
Date: Fri Aug 12 10:39:13 2016
New Revision: 1756139
URL: http://svn.apache.org/viewvc?rev=1756139&view=rev
Log:
JEXL:
Preparing for release
Modified:
commons/proper/jexl/trunk/RELEASE-NOTES.txt
commons/proper/jexl/trunk/pom.xml
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/JexlContext.java
commons/proper/jexl/trunk/src/site/xdoc/changes.xml
commons/proper/jexl/trunk/src/site/xdoc/reference/syntax.xml
Modified: commons/proper/jexl/trunk/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/RELEASE-NOTES.txt?rev=1756139&r1=1756138&r2=1756139&view=diff
==============================================================================
--- commons/proper/jexl/trunk/RELEASE-NOTES.txt (original)
+++ commons/proper/jexl/trunk/RELEASE-NOTES.txt Fri Aug 12 10:39:13 2016
@@ -20,12 +20,24 @@ Its goal is to expose scripting features
========================================================================================================================
-Release 3.0.1
+Release 3.1
========================================================================================================================
-Version 3.0.1 is a micro release to fix issues detected so far in 3.0:
+Version 3.1 is a minor release.
-Bugs Fixed in 3.0.1:
+What's new in 3.1:
+==================
+* Annotations syntax (@annotation) and processing capabilities.
+* Better support for script execution options, error handling and canceling.
+* All operators can be overloaded.
+
+New Features in 3.1:
+====================
+* JEXL-201: Allow Interpreter to use live values from JexlEngine.Option interface implemented by JexlContext
+* JEXL-197: Add annotations
+* JEXL-194 Allow synchronization on iterableValue in foreach statement
+
+Bugs Fixed in 3.1:
====================
* JEXL-210: The way to cancel script execution with an error
* JEXL-209: Unsolvable function/method '<?>.<null>(...)'
@@ -35,10 +47,8 @@ Bugs Fixed in 3.0.1:
* JEXL-204: Script is not interrupted by a method call throwing Exception
* JEXL-203: JexlArithmetic.options() diverts Interpreter to use default implementation of JexlArithmetic instead of custom one
* JEXL-202: Detect invalid assignment operator usage with non-assignable l-value during script parsing
-* JEXL-201: Allow Interpreter to use live values from JexlEngine.Option interface implemented by JexlContext
* JEXL-198: JxltEngine Template does not expose pragmas
* JEXL-196: Script execution hangs while calling method with one argument without parameter
-* JEXL-194 allow synchronization on iterableValue in foreach statement
* JEXL-195: Support for AtomicBoolean in logical expressions
* JEXL-193: InterruptedException is swallowed in function call in silent and non-strict mode
* JEXL-192: Invalid return type when expected result is null
Modified: commons/proper/jexl/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/pom.xml?rev=1756139&r1=1756138&r2=1756139&view=diff
==============================================================================
--- commons/proper/jexl/trunk/pom.xml (original)
+++ commons/proper/jexl/trunk/pom.xml Fri Aug 12 10:39:13 2016
@@ -24,7 +24,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-jexl3</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.1-SNAPSHOT</version>
<name>Apache Commons JEXL</name>
<inceptionYear>2001</inceptionYear>
<description>The Apache Commons JEXL library is an implementation of the JSTL Expression Language with extensions.</description>
Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/JexlContext.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/JexlContext.java?rev=1756139&r1=1756138&r2=1756139&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/JexlContext.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/JexlContext.java Fri Aug 12 10:39:13 2016
@@ -66,8 +66,8 @@ public interface JexlContext {
boolean has(String name);
/**
- * This interface declares how to resolve a namespace from its name; it is used by the interpreter during
- * evaluation.
+ * A marker interface of the JexlContext that declares how to resolve a namespace from its name;
+ * it is used by the interpreter during evaluation.
*
* <p>In JEXL, a namespace is an object that serves the purpose of encapsulating functions; for instance,
* the "math" namespace would be the proper object to expose functions like "log(...)", "sinus(...)", etc.</p>
@@ -90,7 +90,8 @@ public interface JexlContext {
}
/**
- * Namespace type that allows creating an instance to delegate namespace methods calls to.
+ * A marker interface of the JexlContext, NamespaceFunctor allows creating an instance
+ * to delegate namespace methods calls to.
*
* <p>The functor is created once during the lifetime of a script evaluation.</p>
*/
@@ -104,8 +105,8 @@ public interface JexlContext {
}
/**
- * A marker interface that indicates the interpreter to put this context in the JexlEngine thread local context
- * instance during evaluation.
+ * A marker interface of the JexlContext that indicates the interpreter to put this context
+ * in the JexlEngine thread local context instance during evaluation.
* This allows user functions or methods to access the context during a call.
* Note that the usual caveats wrt using thread local apply (caching/leaking references, etc.); in particular,
* keeping a reference to such a context is to be considered with great care and caution.
@@ -115,20 +116,26 @@ public interface JexlContext {
* @see JexlEngine#setThreadContext(JexlContext.ThreadLocal)
* @see JexlEngine#getThreadContext()
*/
- interface ThreadLocal extends JexlContext {
+ interface ThreadLocal {
// no specific method
}
/**
- * This interface declares how to process annotations; it is used by the interpreter during
- * evaluation.
- * <p>All annotations are processed through this method; the statement should be
+ * A marker interface of the JexlContext that allows to process annotations.
+ * It is used by the interpreter during evaluation to execute annotation evaluations.
+ * <p>If the JexlContext is not an instance of an AnnotationProcessor, encountering an annotation will generate
+ * an error or a warning depending on the engine strictness.
*/
interface AnnotationProcessor {
/**
* Processes an annotation.
+ * <p>All annotations are processed through this method; the statement 'call' is to be performed within
+ * the processAnnotation method. The implementation <em>must</em> perform the call explicitly.
+ * <p>The arguments and the statement <em>must not</em> be referenced or cached for longer than the duration
+ * of the processAnnotation call.
+ *
* @param name the annotation name
- * @param args the arguments
+ * @param args the arguments of the annotation, evaluated as arguments of this call
* @param statement the statement that was annotated; the processor should invoke this statement 'call' method
* @return the result of statement.call()
* @throws Exception if annotation processing fails
Modified: commons/proper/jexl/trunk/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/site/xdoc/changes.xml?rev=1756139&r1=1756138&r2=1756139&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/jexl/trunk/src/site/xdoc/changes.xml Fri Aug 12 10:39:13 2016
@@ -25,7 +25,7 @@
<author email="dev@commons.apache.org">Commons Developers</author>
</properties>
<body>
- <release version="3.0.1" date="unreleased">
+ <release version="3.1" date="unreleased">
<action dev="henrib" type="fix" issue="JEXL-210" due-to="Dmitri Blinov">
The way to cancel script execution with an error
</action>
@@ -56,13 +56,16 @@
<action dev="henrib" type="fix" issue="JEXL-198" due-to="Terefang Verigorn">
JxltEngine Template does not expose pragmas
</action>
+ <action dev="henrib" type="add" issue="JEXL-197" due-to="Dmitri Blinov">
+ Add annotations
+ </action>
<action dev="henrib" type="fix" issue="JEXL-196" due-to="Dmitri Blinov">
Script execution hangs while calling method with one argument without parameter
</action>
<action dev="henrib" type="fix" issue="JEXL-195" due-to="Dmitri Blinov">
Support for AtomicBoolean in logical expressions
</action>
- <action dev="henrib" type="fix" issue="JEXL-194" due-to="Dmitri Blinov">
+ <action dev="henrib" type="add" issue="JEXL-194" due-to="Dmitri Blinov">
allow synchronization on iterableValue in foreach statement
</action>
<action dev="henrib" type="fix" issue="JEXL-193" due-to="Dmitri Blinov">
Modified: commons/proper/jexl/trunk/src/site/xdoc/reference/syntax.xml
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/site/xdoc/reference/syntax.xml?rev=1756139&r1=1756138&r2=1756139&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/site/xdoc/reference/syntax.xml (original)
+++ commons/proper/jexl/trunk/src/site/xdoc/reference/syntax.xml Fri Aug 12 10:39:13 2016
@@ -171,6 +171,28 @@
real, string, null, NaN) and antish names</p>
</td>
</tr>
+ <tr>
+ <td>@annotation</td>
+ <td>
+ Annotations in JEXL are 'meta-statements'; they allow to wrap the execution of the JEXL statement in a user provided
+ caller; typical example would be: <source>@synchronized(x) x.someMethod();</source>
+ <p>
+ Annotations may be declared with zero or more paramaters;
+ <source>@lenient x.someMethod();</source>
+ <source>@synchronized(x) x.someMethod();</source>
+ <source>@parallel(pool, 8) x.someMethod();</source>
+ </p>
+ <p>
+ They also can be chained as in:
+ <source>@lenient @silent x.someMethod();</source>
+ </p>
+ <p>
+ Annotation processing is implemented by providing a JexlContext.AnnotationProcessor; its processAnnotation
+ method will call the annotated statement encapsulated in a Callable. Annotation arguments are evaluated
+ and passed as arguments to processAnnotation.
+ </p>
+ </td>
+ </tr>
</table>
</section>
<section name="Literals">