commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hen...@apache.org
Subject svn commit: r885754 - in /commons/proper/jexl/trunk: compat/ compat/commons-jexl-compat/ compat/commons-jexl-compat/src/ compat/commons-jexl-compat/src/main/ compat/commons-jexl-compat/src/main/java/ compat/commons-jexl-compat/src/main/java/org/ compat...
Date Tue, 01 Dec 2009 12:47:02 GMT
Author: henrib
Date: Tue Dec  1 12:47:00 2009
New Revision: 885754

URL: http://svn.apache.org/viewvc?rev=885754&view=rev
Log:
Added compat directory that contains Jexl-1.x compatible implementations of most common classes; this is intended to facilitate trivial upgrades to 2.0 (Jelly for instance). As of now, the compatibility jar is not built automatically (need to do some research on how to do this correctly).
As a result, the deprecated classes ({Script,Expression}Factory) have been moved to this package.

Added:
    commons/proper/jexl/trunk/compat/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/pom.xml   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/Expression.java   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/ExpressionFactory.java   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlContext.java   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlHelper.java   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlOne.java   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/Script.java   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/ScriptFactory.java   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/HashMapContext.java   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/package.html   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/package.html   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/resources/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/test/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/test/java/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/test/java/org/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/test/java/org/apache/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/test/java/org/apache/commons/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/test/java/org/apache/commons/jexl/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/src/test/java/org/apache/commons/jexl/ScriptTest.java   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/Expression.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/ExpressionFactory.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlContext.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlHelper.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$1.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$ContextAdapter.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$EngineHolder.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$JexlOneEngine.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$JexlOneExpression.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$JexlOneInterpreter.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/Script.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/ScriptFactory.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/context/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/context/HashMapContext.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/commons-jexl-compat-2.0-SNAPSHOT.jar   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/maven-archiver/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/maven-archiver/pom.properties   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/osgi/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/osgi/MANIFEST.MF   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/TEST-org.apache.commons.jexl.ScriptTest.xml   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/org.apache.commons.jexl.ScriptTest.txt   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/org/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/org/apache/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/org/apache/commons/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/org/apache/commons/jexl/
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/org/apache/commons/jexl/ScriptTest$Tester.class   (with props)
    commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/org/apache/commons/jexl/ScriptTest.class   (with props)
Removed:
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ExpressionFactory.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ScriptFactory.java
Modified:
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ExpressionImpl.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlEngine.java
    commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ScriptTest.java

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/pom.xml?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/pom.xml (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/pom.xml Tue Dec  1 12:47:00 2009
@@ -0,0 +1,86 @@
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-parent</artifactId>
+        <version>12</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.commons</groupId>
+    <artifactId>commons-jexl-compat</artifactId>
+    <name>Commons JEXL (1.x compatibility)</name>
+    <version>2.0-SNAPSHOT</version>
+    <inceptionYear>2003</inceptionYear>
+    <description>Jexl is an implementation of the JSTL Expression Language with extensions.</description>
+    <url>http://commons.apache.org/jexl/</url>
+
+    <issueManagement>
+        <system>jira</system>
+        <url>http://issues.apache.org/jira/browse/JEXL</url>
+    </issueManagement>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/commons/proper/jexl/trunk</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/commons/proper/jexl/trunk</developerConnection>
+        <url>http://svn.apache.org/viewvc/commons/proper/jexl/trunk</url>
+    </scm>
+
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <includes>
+                        <include>**/*Test.java</include>
+                    </includes>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-jexl</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+
+    <properties>
+        <maven.compile.source>1.5</maven.compile.source>
+        <maven.compile.target>1.5</maven.compile.target>
+        <commons.componentid>jexl-compat</commons.componentid>
+        <commons.release.version>2.0</commons.release.version>
+        <!-- The RC version used in the staging repository URL. -->
+        <commons.rc.version>RC3</commons.rc.version>
+        <commons.binary.suffix />
+        <commons.jira.id>JEXL</commons.jira.id>
+        <commons.jira.pid>12310479</commons.jira.pid>
+        <!-- Temp fix until parent POM is updated -->
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+    </properties>
+</project>
+

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/Expression.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/Expression.java?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/Expression.java (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/Expression.java Tue Dec  1 12:47:00 2009
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.jexl;
+
+/**
+ * Jexl-1.x compatible expression.
+ * @since 2.0
+ * @version $Id$
+ */
+public interface Expression extends org.apache.commons.jexl2.Expression {
+    /**
+     * Evaluates the expression with the variables contained in the
+     * supplied {@link JexlContext}.
+     *
+     * @param context A JexlContext containing variables.
+     * @return The result of this evaluation
+     * @throws Exception on any error
+     */
+    Object evaluate(JexlContext context) throws Exception;
+}

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/Expression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/ExpressionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/ExpressionFactory.java?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/ExpressionFactory.java (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/ExpressionFactory.java Tue Dec  1 12:47:00 2009
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.jexl;
+
+import org.apache.commons.jexl2.JexlEngine;
+
+/**
+ * Creates Expression objects. 
+ * <p>
+ * To create a JEXL Expression object, pass
+ * valid JEXL syntax to the static createExpression() method:
+ * </p>
+ *
+ * <pre>
+ * String jexl = "array[1]";
+ * Expression expression = ExpressionFactory.createExpression( jexl );
+ * </pre>
+ *
+ * <p>
+ * When an {@link Expression} object is created, the JEXL syntax is
+ * parsed and verified.  If the supplied expression is neither an
+ * expression nor a reference, an exception is thrown from createException().
+ * </p>
+ * 
+ * <p>
+ * This is a convenience class; using an instance of a {@link JexlEngine}
+ * that serves the same purpose with more control is recommended.
+ * </p>
+ * @since 1.0
+ * @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
+ * @version $Id: ExpressionFactory.java 884175 2009-11-25 16:23:41Z henrib $
+ * @deprecated Create a JexlEngine and use the createScript method on that instead.
+ */
+@Deprecated
+public final class ExpressionFactory extends JexlOne {}

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/ExpressionFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlContext.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlContext.java?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlContext.java (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlContext.java Tue Dec  1 12:47:00 2009
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.jexl;
+
+import java.util.Map;
+
+/**
+ * Holds a Map of variables which are referenced in a JEXL expression.
+ *
+ *  @since 1.0
+ *  @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
+ *  @version $Id: JexlContext.java 480412 2006-11-29 05:11:23Z bayard $
+ */
+public interface JexlContext {
+    /**
+     * Replaces variables in a JexlContext with the variables contained
+     * in the supplied Map.  When setVars() is called on a JexlContext,
+     * it clears the current Map and puts each entry of the
+     * supplied Map into the current variable Map.
+     *
+     * @param vars Contents of vars will be replaced with the content
+     *      of this Map
+     */
+    void setVars(Map<String,Object> vars);
+
+    /**
+     * Retrives the Map of variables associated with this JexlContext.  The
+     * keys of this map correspond to variable names referenced in a
+     * JEXL expression.
+     *
+     * @return A reference to the variable Map associated with this JexlContext.
+     */
+    Map<String,Object> getVars();
+}

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlHelper.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlHelper.java?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlHelper.java (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlHelper.java Tue Dec  1 12:47:00 2009
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.jexl;
+
+import org.apache.commons.jexl.context.HashMapContext;
+
+/**
+ *  Helper to create a context.  In the current implementation of JEXL, there
+ *  is one implementation of JexlContext - {@link HashMapContext}, and there
+ *  is no reason not to directly instantiate {@link HashMapContext} in your
+ *  own application.
+ *
+ *  @since 1.0
+ *  @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
+ *  @version $Id: JexlHelper.java 480412 2006-11-29 05:11:23Z bayard $
+ */
+public class JexlHelper {
+    /** singleton instance. */
+    protected static JexlHelper helper = new JexlHelper();
+
+    /** @return the single instance. */
+    protected static JexlHelper getInstance() {
+        return helper;
+    }
+
+    /**
+     * Returns a new {@link JexlContext}.
+     * @return a new JexlContext
+     */
+    public static JexlContext createContext() {
+        return getInstance().newContext();
+    }
+
+    /**
+     * Creates and returns a new {@link JexlContext}.  
+     * The current implementation creates a new instance of 
+     * {@link HashMapContext}.
+     * @return a new JexlContext
+     */
+    protected JexlContext newContext() {
+        return new HashMapContext();
+    }
+}

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlOne.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlOne.java?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlOne.java (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlOne.java Tue Dec  1 12:47:00 2009
@@ -0,0 +1,277 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.jexl;
+
+import java.io.File;
+import java.net.URL;
+import org.apache.commons.jexl2.JexlEngine;
+import org.apache.commons.jexl2.Interpreter;
+import org.apache.commons.jexl2.JexlException;
+import org.apache.commons.jexl2.parser.JexlNode;
+import org.apache.commons.jexl2.parser.ASTJexlScript;
+
+/**
+ * This implements Jexl-1.x (Jelly) compatible behaviors on top of Jexl-2.0.
+ * @since 2.0
+ * @version $Id$
+ */
+public class JexlOne {
+    /**
+     * Default cache size.
+     */
+    private static final int CACHE_SIZE = 256;
+
+    /**
+     * Private constructor, ensure no instance.
+     */
+    protected JexlOne() {}
+
+
+    /**
+     * Lazy JexlEngine singleton through on demand holder idiom.
+     */
+    private static final class EngineHolder {
+        /** The shared instance. */
+        static final JexlOneEngine JEXL10 = new JexlOneEngine();
+        /**
+         * Non-instantiable.
+         */
+        private EngineHolder() {}
+    }
+
+
+    /**
+     * A Jexl1.x context wrapped into a Jexl2 context.
+     */
+    private static final class ContextAdapter implements org.apache.commons.jexl2.JexlContext {
+        /** The Jexl1.x context. */
+        private final JexlContext legacy;
+
+        /**
+         * Creates a jexl2.JexlContext from a jexl.JexlContext.
+         * @param ctxt10
+         */
+        ContextAdapter(JexlContext ctxt10) {
+            legacy = ctxt10;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public Object get(String name) {
+            return legacy.getVars().get(name);
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public void set(String name, Object value) {
+            legacy.getVars().put(name, value);
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public boolean has(String name) {
+            return legacy.getVars().containsKey(name);
+        }
+
+        /**
+         * Adapts a Jexl-1.x context to a Jexl-2.0 context.
+         * @param aContext a oac.jexl context
+         * @return an oac.jexl2 context
+         */
+        static final org.apache.commons.jexl2.JexlContext adapt(JexlContext aContext) {
+            return aContext == null ? JexlOneEngine.EMPTY_CONTEXT : new ContextAdapter(aContext);
+        }
+    }
+
+
+    /**
+     * An interpreter made compatible with v1.1 behavior (at least Jelly's expectations).
+     */
+    private static final class JexlOneInterpreter extends Interpreter {
+        /**
+         * Creates an instance.
+         * @param jexl the jexl engine
+         * @param aContext the jexl context
+         */
+        public JexlOneInterpreter(JexlEngine jexl, JexlContext aContext) {
+            super(jexl, ContextAdapter.adapt(aContext));
+        }
+
+        /**{@inheritDoc}*/
+        @Override
+        public Object interpret(JexlNode node) {
+            try {
+                return node.jjtAccept(this, null);
+            } catch (JexlException xjexl) {
+                Throwable e = xjexl.getCause();
+                if (e instanceof RuntimeException) {
+                    throw (RuntimeException) e;
+                }
+                if (e instanceof IllegalStateException) {
+                    throw (IllegalStateException) e;
+                }
+                throw new IllegalStateException(e.getMessage(), e);
+            }
+        }
+
+        /**{@inheritDoc}*/
+        @Override
+        protected Object invocationFailed(JexlException xjexl) {
+            throw xjexl;
+        }
+
+        /**{@inheritDoc}*/
+        @Override
+        protected Object unknownVariable(JexlException xjexl) {
+            return null;
+        }
+    }
+
+    
+    /**
+     * An engine that uses a JexlOneInterpreter.
+     */
+    private static final class JexlOneEngine extends JexlEngine {
+        /**
+         * Default ctor, creates a cache and sets instance to verbose (ie non-silent).
+         */
+        private JexlOneEngine() {
+            super();
+            setCache(CACHE_SIZE);
+            setSilent(false);
+        }
+
+        /**{@inheritDoc}*/
+        protected Interpreter createInterpreter(JexlContext context) {
+            return new JexlOne.JexlOneInterpreter(this, context);
+        }
+
+        /** {@inheritDoc} */
+        @Override
+        protected Script createScript(ASTJexlScript tree, String text) {
+            return new JexlOneExpression(this, text, tree);
+        }
+
+        /** {@inheritDoc} */
+        @Override
+        protected Expression createExpression(ASTJexlScript tree, String text) {
+            return new JexlOneExpression(this, text, tree);
+        }
+    }
+
+    /**
+     * The specific Jexl-1.x expressions implementation.
+     */
+    private static final class JexlOneExpression
+            extends org.apache.commons.jexl2.ExpressionImpl
+            implements Expression, Script {
+        /**
+         * Default local ctor.
+         *
+         * @param engine the interpreter to evaluate the expression
+         * @param expr the expression.
+         * @param ref the parsed expression.
+         */
+        private JexlOneExpression(JexlOne.JexlOneEngine engine, String expr, ASTJexlScript ref) {
+            super(engine, expr, ref);
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public Object evaluate(JexlContext context) {
+            return super.evaluate(ContextAdapter.adapt(context));
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public Object execute(JexlContext context) {
+            return super.execute(ContextAdapter.adapt(context));
+        }
+    }
+
+
+    /**
+     * Creates a Script from a String containing valid JEXL syntax.
+     * This method parses the script which validates the syntax.
+     *
+     * @param scriptText A String containing valid JEXL syntax
+     * @return A {@link Script} which can be executed with a
+     *      {@link JexlContext}.
+     * @throws Exception An exception can be thrown if there is a
+     *      problem parsing the script.
+     * @deprecated Create a JexlEngine and use the createScript method on that instead.
+     */
+    @Deprecated
+    public static Script createScript(String scriptText) throws Exception {
+        return (Script) EngineHolder.JEXL10.createScript(scriptText);
+    }
+
+    /**
+     * Creates a Script from a {@link File} containing valid JEXL syntax.
+     * This method parses the script and validates the syntax.
+     *
+     * @param scriptFile A {@link File} containing valid JEXL syntax.
+     *      Must not be null. Must be a readable file.
+     * @return A {@link Script} which can be executed with a
+     *      {@link JexlContext}.
+     * @throws Exception An exception can be thrown if there is a problem
+     *      parsing the script.
+     * @deprecated Create a JexlEngine and use the createScript method on that instead.
+     */
+    @Deprecated
+    public static Script createScript(File scriptFile) throws Exception {
+        return (Script) EngineHolder.JEXL10.createScript(scriptFile);
+    }
+
+    /**
+     * Creates a Script from a {@link URL} containing valid JEXL syntax.
+     * This method parses the script and validates the syntax.
+     *
+     * @param scriptUrl A {@link URL} containing valid JEXL syntax.
+     *      Must not be null. Must be a readable file.
+     * @return A {@link Script} which can be executed with a
+     *      {@link JexlContext}.
+     * @throws Exception An exception can be thrown if there is a problem
+     *      parsing the script.
+     * @deprecated Create a JexlEngine and use the createScript method on that instead.
+     */
+    @Deprecated
+    public static Script createScript(URL scriptUrl) throws Exception {
+        return (Script) EngineHolder.JEXL10.createScript(scriptUrl);
+    }
+
+    /**
+     * Creates an Expression from a String containing valid
+     * JEXL syntax.  This method parses the expression which
+     * must contain either a reference or an expression.
+     * @param expression A String containing valid JEXL syntax
+     * @return An Expression object which can be evaluated with a JexlContext
+     * @throws JexlException An exception can be thrown if there is a problem
+     *      parsing this expression, or if the expression is neither an
+     *      expression or a reference.
+     * @deprecated Create a JexlEngine and use createExpression() on that
+     */
+    @Deprecated
+    public static Expression createExpression(String expression) {
+        return (Expression) EngineHolder.JEXL10.createExpression(expression);
+    }
+}

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/JexlOne.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/Script.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/Script.java?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/Script.java (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/Script.java Tue Dec  1 12:47:00 2009
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.jexl;
+
+/**
+ * Jexl-1.x compatible script.
+ * @since 2.0
+ * @version $Id$
+ */
+public interface Script extends org.apache.commons.jexl2.Script {
+    /**
+     * Executes the script with the variables contained in the
+     * supplied {@link JexlContext}. 
+     * 
+     * @param context A JexlContext containing variables.
+     * @return The result of this script, usually the result of 
+     *      the last statement.
+     * @throws Exception on any script parse or execution error.
+     */
+    Object execute(JexlContext context) throws Exception;
+}

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/Script.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/ScriptFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/ScriptFactory.java?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/ScriptFactory.java (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/ScriptFactory.java Tue Dec  1 12:47:00 2009
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.jexl;
+
+import org.apache.commons.jexl2.JexlEngine;
+
+/**
+ * <p>
+ * Creates {@link Script}s.  To create a JEXL Script, pass
+ * valid JEXL syntax to the static createScript() method:
+ * </p>
+ *
+ * <pre>
+ * String jexl = "y = x * 12 + 44; y = y * 4;";
+ * Script script = ScriptFactory.createScript( jexl );
+ * </pre>
+ *
+ * <p>
+ * When an {@link Script} is created, the JEXL syntax is
+ * parsed and verified.
+ * </p>
+ *
+ * <p>
+ * This is a convenience class; using an instance of a {@link JexlEngine}
+ * that serves the same purpose with more control is recommended.
+ * </p>
+ * @since 1.1
+ * @version $Id: ScriptFactory.java 884175 2009-11-25 16:23:41Z henrib $
+ * @deprecated Create a JexlEngine and use the createScript method on that instead.
+ */
+@Deprecated
+public final class ScriptFactory extends JexlOne {}
+

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/ScriptFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/HashMapContext.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/HashMapContext.java?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/HashMapContext.java (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/HashMapContext.java Tue Dec  1 12:47:00 2009
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.jexl.context;
+
+import org.apache.commons.jexl.JexlContext;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *  Implementation of JexlContext based on a HashMap.
+ *
+ *  @since 1.0
+ *  @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
+ *  @version $Id: HashMapContext.java 706202 2008-10-20 10:28:25Z sebb $
+ */
+public class HashMapContext extends HashMap<String,Object> implements JexlContext {
+    /** serialization version id jdk13 generated. */
+    private static final long serialVersionUID = 5715964743204418854L;
+    /**
+     * {@inheritDoc}
+     */
+    public void setVars(Map<String,Object> vars) {
+        clear();
+        putAll(vars);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Map<String,Object> getVars() {
+        return this;
+    }
+}

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/HashMapContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/package.html
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/package.html?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/package.html (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/package.html Tue Dec  1 12:47:00 2009
@@ -0,0 +1,20 @@
+<html>
+ <head>
+  <title>Package Documentation for org.apache.commons.jexl.context Package</title>
+ </head>
+ <body bgcolor="white">
+  Simple JexlContext implementations.
+  <br><br>
+  <p>
+   <ul>
+    <li><a href="#intro">Introduction</a></li>
+   </ul>
+  </p>
+  <h2><a name="intro">Introduction</a></h2>
+  <p>
+   This package only contains one JexlContext implementation, the
+   HashMapContext.  A HashMapContext is simply an extension of
+   HashMap which implements the JexlContext interface.
+  </p>
+</body>
+</html>

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/context/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/package.html
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/package.html?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/package.html (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/package.html Tue Dec  1 12:47:00 2009
@@ -0,0 +1,23 @@
+<html>
+    <head>
+        <title>Package Documentation for org.apache.commons.jexl Package</title>
+    </head>
+    <body bgcolor="white">
+        Jexl-1.x compatible implementations.
+        <br>
+        <p>
+            This package only contains classes that re-implement Jexl-1.x interfaces
+            and behaviors. This is intended to allow easier conversion to Jexl-2.0.
+        </p>
+        <p>
+            Jexl-2.0 changed a lot of APIs and behaviors, enough to warrant for putting it
+            in its own org.apache.commons.jexl2 package and avoid possible "jar-hell" cases.
+            Those could have occured if someone was trying to use both Jexl-2.0 and Jexl-1.x.
+        </p>
+        <p>
+            This package contains the original Jexl-1.x main API namely ScriptFactory, ExpressionFactory,
+            Script, Expression, JexlContext and JexlHelper. It is not 100% compatible with
+            the original Jexl-1.x codeline but should be close enough for "casual" usage.
+        </p>
+    </body>
+</html>

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/main/java/org/apache/commons/jexl/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/test/java/org/apache/commons/jexl/ScriptTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/src/test/java/org/apache/commons/jexl/ScriptTest.java?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/src/test/java/org/apache/commons/jexl/ScriptTest.java (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/src/test/java/org/apache/commons/jexl/ScriptTest.java Tue Dec  1 12:47:00 2009
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.jexl;
+import junit.framework.TestCase;
+import java.io.File;
+import java.net.URL;
+
+/**
+ * Tests for Script
+ * @since 1.1
+ */
+public class ScriptTest extends TestCase {
+    static final String TEST1 =  "../../src/test/scripts/test1.jexl";
+
+    // test class for testScriptUpdatesContext
+    // making this class private static will cause the test to fail.
+    // this is due to unusual code in ClassMap.getAccessibleMethods(Class)
+    // that treats non-public classes in a specific way. Why getAccessibleMethods
+    // does this is not known yet.
+    public static class Tester {
+        private String code;
+        public String getCode () { 
+            return code; 
+        }
+        public void setCode(String c) {
+            code = c;
+        }
+    }
+    /**
+     * Create a new test case.
+     * @param name case name
+     */
+    public ScriptTest(String name) {
+        super(name);
+    }
+
+    /**
+     * Test creating a script from a string.
+     */
+    public void testSimpleScript() throws Exception {
+        String code = "while (x < 10) x = x + 1;";
+        Script s = ScriptFactory.createScript(code);
+        JexlContext jc = JexlHelper.createContext();
+        jc.getVars().put("x", new Integer(1));
+    
+        Object o = s.execute(jc);
+        assertEquals("Result is wrong", new Integer(10), o);
+        assertEquals("getText is wrong", code, s.getText());
+    }
+
+    public void testScriptFromFile() throws Exception {
+        File testScript = new File(TEST1);
+        Script s = ScriptFactory.createScript(testScript);
+        JexlContext jc = JexlHelper.createContext();
+        jc.getVars().put("out", System.out);
+        Object result = s.execute(jc);
+        assertNotNull("No result", result);
+        assertEquals("Wrong result", new Integer(7), result);
+    }
+
+    public void testScriptFromURL() throws Exception {
+        URL testUrl = new File(TEST1).toURI().toURL();
+        Script s = ScriptFactory.createScript(testUrl);
+        JexlContext jc = JexlHelper.createContext();
+        jc.getVars().put("out", System.out);
+        Object result = s.execute(jc);
+        assertNotNull("No result", result);
+        assertEquals("Wrong result", new Integer(7), result);
+    }
+
+    public void testScriptUpdatesContext() throws Exception {
+        String jexlCode = "resultat.setCode('OK')";
+        Expression e = ExpressionFactory.createExpression(jexlCode);
+        Script s = ScriptFactory.createScript(jexlCode);
+
+        Tester resultatJexl = new Tester();
+        JexlContext jc = JexlHelper.createContext();
+        jc.getVars().put("resultat", resultatJexl);
+
+        resultatJexl.setCode("");
+        e.evaluate(jc);
+        assertEquals("OK", resultatJexl.getCode());
+        resultatJexl.setCode("");
+        s.execute(jc);
+        assertEquals("OK", resultatJexl.getCode());
+    }
+
+}

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/src/test/java/org/apache/commons/jexl/ScriptTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/Expression.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/Expression.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/Expression.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/ExpressionFactory.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/ExpressionFactory.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/ExpressionFactory.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlContext.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlContext.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlContext.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlHelper.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlHelper.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlHelper.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$1.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne%241.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$1.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$ContextAdapter.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne%24ContextAdapter.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$ContextAdapter.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$EngineHolder.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne%24EngineHolder.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$EngineHolder.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$JexlOneEngine.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne%24JexlOneEngine.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$JexlOneEngine.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$JexlOneExpression.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne%24JexlOneExpression.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$JexlOneExpression.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$JexlOneInterpreter.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne%24JexlOneInterpreter.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne$JexlOneInterpreter.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/JexlOne.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/Script.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/Script.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/Script.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/ScriptFactory.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/ScriptFactory.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/ScriptFactory.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/context/HashMapContext.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/context/HashMapContext.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/classes/org/apache/commons/jexl/context/HashMapContext.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/commons-jexl-compat-2.0-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/commons-jexl-compat-2.0-SNAPSHOT.jar?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/commons-jexl-compat-2.0-SNAPSHOT.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/maven-archiver/pom.properties
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/maven-archiver/pom.properties?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/target/maven-archiver/pom.properties (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/target/maven-archiver/pom.properties Tue Dec  1 12:47:00 2009
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Tue Dec 01 13:33:27 CET 2009
+version=2.0-SNAPSHOT
+groupId=org.apache.commons
+artifactId=commons-jexl-compat

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/maven-archiver/pom.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/osgi/MANIFEST.MF
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/osgi/MANIFEST.MF?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/target/osgi/MANIFEST.MF (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/target/osgi/MANIFEST.MF Tue Dec  1 12:47:00 2009
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Export-Package: org.apache.commons.jexl;version="2.0.0.SNAPSHOT",org.a
+ pache.commons.jexl.context;version="2.0.0.SNAPSHOT"
+Tool: Bnd-0.0.238
+Bundle-Name: Commons JEXL (1.x compatibility)
+Created-By: 1.6.0_15 (Apple Inc.)
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0.SNAPSHOT
+Bnd-LastModified: 1259670805939
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Jexl is an implementation of the JSTL Expression L
+ anguage with extensions.
+Import-Package: org.apache.commons.jexl;version="2.0.0.SNAPSHOT",org.a
+ pache.commons.jexl.context;version="2.0.0.SNAPSHOT",org.apache.common
+ s.jexl2,org.apache.commons.jexl2.parser
+Bundle-SymbolicName: org.apache.commons.jexl-compat
+Bundle-DocURL: http://commons.apache.org/jexl/
+

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/osgi/MANIFEST.MF
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/TEST-org.apache.commons.jexl.ScriptTest.xml
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/TEST-org.apache.commons.jexl.ScriptTest.xml?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/TEST-org.apache.commons.jexl.ScriptTest.xml (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/TEST-org.apache.commons.jexl.ScriptTest.xml Tue Dec  1 12:47:00 2009
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite failures="0" time="0.134" errors="0" skipped="0" tests="4" name="org.apache.commons.jexl.ScriptTest">
+  <properties>
+    <property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
+    <property name="sun.boot.library.path" value="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Libraries"/>
+    <property name="java.vm.version" value="14.1-b02-90"/>
+    <property name="awt.nativeDoubleBuffering" value="true"/>
+    <property name="gopherProxySet" value="false"/>
+    <property name="java.vm.vendor" value="Apple Inc."/>
+    <property name="java.vendor.url" value="http://www.apple.com/"/>
+    <property name="path.separator" value=":"/>
+    <property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
+    <property name="file.encoding.pkg" value="sun.io"/>
+    <property name="user.country" value="US"/>
+    <property name="sun.java.launcher" value="SUN_STANDARD"/>
+    <property name="sun.os.patch.level" value="unknown"/>
+    <property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
+    <property name="user.dir" value="/Users/henri/Java/apache-commons/commons-parent-12/jexl-2.0/compat/commons-jexl-compat"/>
+    <property name="java.runtime.version" value="1.6.0_15-b03-219"/>
+    <property name="java.awt.graphicsenv" value="apple.awt.CGraphicsEnvironment"/>
+    <property name="basedir" value="/Users/henri/Java/apache-commons/commons-parent-12/jexl-2.0/compat/commons-jexl-compat"/>
+    <property name="java.endorsed.dirs" value="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/endorsed"/>
+    <property name="os.arch" value="x86_64"/>
+    <property name="surefire.real.class.path" value="/var/folders/Ya/YaSJZzgsHu4O4NXovx-nNE+++TI/-Tmp-/surefirebooter3767222523623553200.jar"/>
+    <property name="java.io.tmpdir" value="/var/folders/Ya/YaSJZzgsHu4O4NXovx-nNE+++TI/-Tmp-/"/>
+    <property name="line.separator" value="
+"/>
+    <property name="java.vm.specification.vendor" value="Sun Microsystems Inc."/>
+    <property name="os.name" value="Mac OS X"/>
+    <property name="sun.jnu.encoding" value="MacRoman"/>
+    <property name="java.library.path" value=".:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java"/>
+    <property name="surefire.test.class.path" value="/Users/henri/Java/apache-commons/commons-parent-12/jexl-2.0/compat/commons-jexl-compat/target/test-classes:/Users/henri/Java/apache-commons/commons-parent-12/jexl-2.0/compat/commons-jexl-compat/target/classes:/Users/henri/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:/Users/henri/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/Users/henri/.m2/repository/org/apache/commons/commons-jexl/2.0-SNAPSHOT/commons-jexl-2.0-SNAPSHOT.jar:/Users/henri/.m2/repository/org/apache/bsf/bsf-api/3.0-beta3/bsf-api-3.0-beta3.jar:"/>
+    <property name="java.specification.name" value="Java Platform API Specification"/>
+    <property name="java.class.version" value="50.0"/>
+    <property name="sun.management.compiler" value="HotSpot 64-Bit Server Compiler"/>
+    <property name="os.version" value="10.6.2"/>
+    <property name="http.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
+    <property name="user.home" value="/Users/henri"/>
+    <property name="user.timezone" value=""/>
+    <property name="java.awt.printerjob" value="apple.awt.CPrinterJob"/>
+    <property name="java.specification.version" value="1.6"/>
+    <property name="file.encoding" value="MacRoman"/>
+    <property name="user.name" value="henri"/>
+    <property name="java.class.path" value="/Users/henri/Java/apache-commons/commons-parent-12/jexl-2.0/compat/commons-jexl-compat/target/test-classes:/Users/henri/Java/apache-commons/commons-parent-12/jexl-2.0/compat/commons-jexl-compat/target/classes:/Users/henri/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:/Users/henri/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/Users/henri/.m2/repository/org/apache/commons/commons-jexl/2.0-SNAPSHOT/commons-jexl-2.0-SNAPSHOT.jar:/Users/henri/.m2/repository/org/apache/bsf/bsf-api/3.0-beta3/bsf-api-3.0-beta3.jar:"/>
+    <property name="java.vm.specification.version" value="1.0"/>
+    <property name="sun.arch.data.model" value="64"/>
+    <property name="java.home" value="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home"/>
+    <property name="java.specification.vendor" value="Sun Microsystems Inc."/>
+    <property name="user.language" value="en"/>
+    <property name="awt.toolkit" value="apple.awt.CToolkit"/>
+    <property name="java.vm.info" value="mixed mode"/>
+    <property name="java.version" value="1.6.0_15"/>
+    <property name="java.ext.dirs" value="/Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/ext"/>
+    <property name="sun.boot.class.path" value="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/jsfd.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/sunrsasign.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/charsets.jar"/>
+    <property name="java.vendor" value="Apple Inc."/>
+    <property name="localRepository" value="/Users/henri/.m2/repository"/>
+    <property name="file.separator" value="/"/>
+    <property name="java.vendor.url.bug" value="http://bugreport.apple.com/"/>
+    <property name="sun.cpu.endian" value="little"/>
+    <property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
+    <property name="mrj.version" value="1060.1.6.0_15-219"/>
+    <property name="socksNonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
+    <property name="ftp.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
+    <property name="sun.cpu.isalist" value=""/>
+  </properties>
+  <testcase time="0.096" classname="org.apache.commons.jexl.ScriptTest" name="testSimpleScript"/>
+  <testcase time="0.015" classname="org.apache.commons.jexl.ScriptTest" name="testScriptFromFile"/>
+  <testcase time="0.003" classname="org.apache.commons.jexl.ScriptTest" name="testScriptFromURL"/>
+  <testcase time="0.002" classname="org.apache.commons.jexl.ScriptTest" name="testScriptUpdatesContext"/>
+</testsuite>
\ No newline at end of file

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/TEST-org.apache.commons.jexl.ScriptTest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/org.apache.commons.jexl.ScriptTest.txt
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/org.apache.commons.jexl.ScriptTest.txt?rev=885754&view=auto
==============================================================================
--- commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/org.apache.commons.jexl.ScriptTest.txt (added)
+++ commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/org.apache.commons.jexl.ScriptTest.txt Tue Dec  1 12:47:00 2009
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------------------
+Test set: org.apache.commons.jexl.ScriptTest
+-------------------------------------------------------------------------------
+Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.141 sec

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/surefire-reports/org.apache.commons.jexl.ScriptTest.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/org/apache/commons/jexl/ScriptTest$Tester.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/org/apache/commons/jexl/ScriptTest%24Tester.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/org/apache/commons/jexl/ScriptTest$Tester.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/org/apache/commons/jexl/ScriptTest.class
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/org/apache/commons/jexl/ScriptTest.class?rev=885754&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/jexl/trunk/compat/commons-jexl-compat/target/test-classes/org/apache/commons/jexl/ScriptTest.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ExpressionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ExpressionImpl.java?rev=885754&r1=885753&r2=885754&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ExpressionImpl.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ExpressionImpl.java Tue Dec  1 12:47:00 2009
@@ -23,12 +23,11 @@
  * Instances of ExpressionImpl are created by the {@link JexlEngine},
  * and this is the default implementation of the {@link Expression} and
  * {@link Script} interface.
- *
  * @since 1.0
  * @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
  * @version $Id$
  */
-class ExpressionImpl implements Expression, Script {
+public class ExpressionImpl implements Expression, Script {
     /** The engine for this expression. */
     protected final JexlEngine jexl;
     /**
@@ -48,10 +47,10 @@
      * @param expr the expression.
      * @param ref the parsed expression.
      */
-    ExpressionImpl(JexlEngine engine, String expr, ASTJexlScript ref) {
+    protected ExpressionImpl(JexlEngine engine, String expr, ASTJexlScript ref) {
+        jexl = engine;
         expression = expr;
         script = ref;
-        jexl = engine;
     }
 
     /**

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlEngine.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlEngine.java?rev=885754&r1=885753&r2=885754&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlEngine.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlEngine.java Tue Dec  1 12:47:00 2009
@@ -91,7 +91,7 @@
     /**
      * An empty/static/non-mutable JexlContext used instead of null context.
      */
-    protected static final JexlContext EMPTY_CONTEXT = new JexlContext() {
+    public static final JexlContext EMPTY_CONTEXT = new JexlContext() {
         /** {@inheritDoc} */
         public Object get(String name) {
             return null;
@@ -115,9 +115,11 @@
      * <p>Implemented as on demand holder idiom.</p>
      *  @return Uberspect the default uberspector instance.
      */
-    private static class UberspectHolder {
+    private static final class UberspectHolder {
         /** The default uberspector that handles all introspection patterns. */
         private static final Uberspect UBERSPECT = new UberspectImpl(LogFactory.getLog(JexlEngine.class));
+        /** Non-instantiable. */
+        private UberspectHolder() {}
     }
     
     /**
@@ -338,6 +340,16 @@
     }
 
     /**
+     * An overridable through covariant return Expression creator.
+     * @param text the script text
+     * @param tree the parse AST tree
+     * @return the script instance
+     */
+    protected Expression createExpression(ASTJexlScript tree, String text) {
+        return new ExpressionImpl(this, text, tree);
+    }
+    
+    /**
      * Creates an Expression from a String containing valid
      * JEXL syntax.  This method parses the expression which
      * must contain either a reference or an expression.
@@ -369,7 +381,7 @@
             logger.warn("The JEXL Expression created will be a reference"
                       + " to the first expression from the supplied script: \"" + expression + "\" ");
         }
-        return new ExpressionImpl(this, expression, tree);
+        return createExpression(tree, expression);
     }
 
     /**
@@ -399,10 +411,20 @@
         }
         // Parse the expression
         ASTJexlScript tree = parse(scriptText, info);
-        return new ExpressionImpl(this, scriptText, tree);
+        return createScript(tree, scriptText);
     }
 
     /**
+     * An overridable through covariant return Script creator.
+     * @param text the script text
+     * @param tree the parse AST tree
+     * @return the script instance
+     */
+    protected Script createScript(ASTJexlScript tree, String text) {
+        return new ExpressionImpl(this, text, tree);
+    }
+    
+    /**
      * Creates a Script from a {@link File} containing valid JEXL syntax.
      * This method parses the script and validates the syntax.
      *
@@ -426,7 +448,6 @@
             info = createInfo(scriptFile.getName(), 0, 0);
         }
         return createScript(readerToString(reader), info);
-
     }
 
     /**
@@ -833,10 +854,6 @@
                         clazz = JexlEngine.class;
                     } else if (className.equals(UnifiedJEXL.class.getName())) {
                         clazz = UnifiedJEXL.class;
-                    } else if (className.equals(ScriptFactory.class.getName())) {
-                        clazz = ScriptFactory.class;
-                    } else if (className.equals(ExpressionFactory.class.getName())) {
-                        clazz = ExpressionFactory.class;
                     } else {
                         break;
                     }

Modified: commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ScriptTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ScriptTest.java?rev=885754&r1=885753&r2=885754&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ScriptTest.java (original)
+++ commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl2/ScriptTest.java Tue Dec  1 12:47:00 2009
@@ -52,14 +52,8 @@
      * Test creating a script from a string.
      */
     public void testSimpleScript() throws Exception {
-        simpleScript(true);
-    }
-    public void testLegacySimpleScript() throws Exception {
-        simpleScript(false);
-    }
-    private void simpleScript(boolean jexl) throws Exception {
         String code = "while (x < 10) x = x + 1;";
-        Script s = jexl? JEXL.createScript(code) : ScriptFactory.createScript(code);
+        Script s = JEXL.createScript(code);
         JexlContext jc = new MapContext();
         jc.set("x", new Integer(1));
     
@@ -69,14 +63,8 @@
     }
 
     public void testScriptFromFile() throws Exception {
-        scriptFromFile(true);
-    }
-    public void testLegacyScriptFromFile() throws Exception {
-        scriptFromFile(false);
-    }
-    private void scriptFromFile(boolean jexl) throws Exception {
         File testScript = new File(TEST1);
-        Script s = jexl? JEXL.createScript(testScript) : ScriptFactory.createScript(testScript);
+        Script s = JEXL.createScript(testScript);
         JexlContext jc = new MapContext();
         jc.set("out", System.out);
         Object result = s.execute(jc);
@@ -85,14 +73,8 @@
     }
 
     public void testScriptFromURL() throws Exception {
-        scriptFromURL(true);
-    }
-    public void testLegacyScriptFromURL() throws Exception {
-        scriptFromURL(false);
-    }
-    private void scriptFromURL(boolean jexl) throws Exception {
         URL testUrl = new File("src/test/scripts/test1.jexl").toURI().toURL();
-        Script s = jexl? JEXL.createScript(testUrl) : ScriptFactory.createScript(testUrl);
+        Script s = JEXL.createScript(testUrl);
         JexlContext jc = new MapContext();
         jc.set("out", System.out);
         Object result = s.execute(jc);
@@ -101,15 +83,9 @@
     }
 
     public void testScriptUpdatesContext() throws Exception {
-        scriptUpdatesContext(true);
-    }
-    public void testLegacyScriptUpdatesContext() throws Exception {
-        scriptUpdatesContext(false);
-    }
-    private void scriptUpdatesContext(boolean jexl) throws Exception {
         String jexlCode = "resultat.setCode('OK')";
-        Expression e = jexl? JEXL.createExpression(jexlCode) : ExpressionFactory.createExpression(jexlCode);
-        Script s = jexl? JEXL.createScript(jexlCode) : ScriptFactory.createScript(jexlCode);
+        Expression e = JEXL.createExpression(jexlCode);
+        Script s = JEXL.createScript(jexlCode);
 
         Tester resultatJexl = new Tester();
         JexlContext jc = new MapContext();



Mime
View raw message