commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hen...@apache.org
Subject svn commit: r1207310 - in /commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2: ./ introspection/
Date Mon, 28 Nov 2011 15:37:42 GMT
Author: henrib
Date: Mon Nov 28 15:37:38 2011
New Revision: 1207310

URL: http://svn.apache.org/viewvc?rev=1207310&view=rev
Log:
Added @since 2.1 annotations;
Renamed Uberspect.getConstructor to Uberspect.getConstructorMethod and readded previous version
(same in UberspectImpl);
Intrepreter silent & strict fields not final, added setters

Modified:
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Debugger.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlEngine.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlException.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlThreadedArithmetic.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/NamespaceResolver.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ObjectContext.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ReadonlyContext.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Script.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/UnifiedJEXL.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/Sandbox.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/SandboxUberspectImpl.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/Uberspect.java
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/UberspectImpl.java

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Debugger.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Debugger.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Debugger.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Debugger.java Mon Nov
28 15:37:38 2011
@@ -134,6 +134,7 @@ final class Debugger implements ParserVi
      * Rebuilds an expression from a Jexl node.
      * @param node the node to rebuilt from
      * @return the rebuilt expression
+     * @since 2.1
      */
     public String data(JexlNode node) {
         start = 0;

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Interpreter.java Mon
Nov 28 15:37:38 2011
@@ -104,9 +104,9 @@ public class Interpreter implements Pars
     /** The context to store/retrieve variables. */
     protected final JexlContext context;
     /** Strict interpreter flag. */
-    protected final boolean strict;
+    protected boolean strict;
     /** Silent intepreter flag. */
-    protected final boolean silent;
+    protected boolean silent;
     /** Cache executors. */
     protected final boolean cache;
     /** Registers or arguments. */
@@ -163,6 +163,24 @@ public class Interpreter implements Pars
         this.context = base.context;
         this.functors = base.functors;
     }
+    
+    /**
+     * Sets whether this interpreter considers unknown variables, methods and constructors
as errors.
+     * @param flag true for strict, false for lenient
+     */
+    @Deprecated
+    public void setStrict(boolean flag) {
+        this.strict = flag;
+    }
+
+    /**
+     * Sets whether this interpreter throws JexlException when encountering errors.
+     * @param flag true for silent, false for verbose
+     */
+    @Deprecated
+    public void setSilent(boolean flag) {
+        this.silent = flag;
+    }
 
     /**
      * Checks whether this interpreter considers unknown variables, methods and constructors
as errors.
@@ -309,6 +327,7 @@ public class Interpreter implements Pars
     /**
      * Checks whether this interpreter execution was cancelled due to thread interruption.
      * @return true if cancelled, false otherwise
+     * @since 2.1
      */
     protected boolean isCancelled() {
         if (cancelled | Thread.interrupted()) {
@@ -347,7 +366,7 @@ public class Interpreter implements Pars
         // allow namespace to be instantiated as functor with context if possible, not an
error otherwise
         if (namespace instanceof Class<?>) {
             Object[] args = new Object[]{context};
-            JexlMethod ctor = uberspect.getConstructor(namespace, args, node);
+            JexlMethod ctor = uberspect.getConstructorMethod(namespace, args, node);
             if (ctor != null) {
                 try {
                     namespace = ctor.invoke(namespace, args);
@@ -1080,11 +1099,11 @@ public class Interpreter implements Pars
                     }
                 }
             }
-            JexlMethod ctor = uberspect.getConstructor(cobject, argv, node);
+            JexlMethod ctor = uberspect.getConstructorMethod(cobject, argv, node);
             // DG: If we can't find an exact match, narrow the parameters and try again
             if (ctor == null) {
                 if (arithmetic.narrowArguments(argv)) {
-                    ctor = uberspect.getConstructor(cobject, argv, node);
+                    ctor = uberspect.getConstructorMethod(cobject, argv, node);
                 }
                 if (ctor == null) {
                     xjexl = new JexlException.Method(node, cobject.toString());

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java Mon
Nov 28 15:37:38 2011
@@ -74,6 +74,7 @@ public class JexlArithmetic {
      * @param lenient whether this arithmetic is lenient or strict
      * @param bigdContext the math context instance to use for +,-,/,*,% operations on big
decimals.
      * @param bigdScale the scale used for big decimals.
+     * @since 2.1
      */
     public JexlArithmetic(boolean lenient, MathContext bigdContext, int bigdScale) {
         this.strict = !lenient;
@@ -93,6 +94,7 @@ public class JexlArithmetic {
     /**
      * The MathContext instance used for +,-,/,*,% operations on big decimals.
      * @return the math context
+     * @since 2.1
      */
     public MathContext getMathContext() {
         return mathContext;
@@ -101,6 +103,7 @@ public class JexlArithmetic {
     /**
      * The BigDecimal scale used for comparison and coericion operations.
      * @return the scale
+     * @since 2.1
      */
     public int getMathScale() {
         return mathScale;
@@ -110,6 +113,7 @@ public class JexlArithmetic {
      * Ensure a big decimal is rounded by this arithmetic scale and rounding mode.
      * @param number the big decimal to round
      * @return the rounded big decimal
+     * @since 2.1
      */
     public BigDecimal roundBigDecimal(final BigDecimal number) {
         int mscale = getMathScale();
@@ -573,6 +577,7 @@ public class JexlArithmetic {
      * @param left first value
      * @param right second value
      * @return test result.
+     * @since 2.1
      */
     public boolean matches(Object left, Object right) {
         if (left == null && right == null) {
@@ -596,6 +601,7 @@ public class JexlArithmetic {
      * @param left the left operand
      * @param right the right operator
      * @return left & right
+     * @since 2.1
      */
     public Object bitwiseAnd(Object left, Object right) {
         long l = toLong(left);
@@ -608,6 +614,7 @@ public class JexlArithmetic {
      * @param left the left operand
      * @param right the right operator
      * @return left | right
+     * @since 2.1
      */
     public Object bitwiseOr(Object left, Object right) {
         long l = toLong(left);
@@ -620,6 +627,7 @@ public class JexlArithmetic {
      * @param left the left operand
      * @param right the right operator
      * @return left  right
+     * @since 2.1
      */
     public Object bitwiseXor(Object left, Object right) {
         long l = toLong(left);
@@ -631,6 +639,7 @@ public class JexlArithmetic {
      * Performs a bitwise complement.
      * @param val the operand
      * @return ~val
+     * @since 2.1
      */
     public Object bitwiseComplement(Object val) {
         long l = toLong(val);
@@ -644,6 +653,7 @@ public class JexlArithmetic {
      * @param operator the operator
      * @return -1 if left  &lt; right; +1 if left &gt > right; 0 if left == right
      * @throws ArithmeticException if either left or right is null
+     * @since 2.1
      */
     protected int compare(Object left, Object right, String operator) {
         if (left != null && right != null) {

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=1207310&r1=1207309&r2=1207310&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 Mon Nov
28 15:37:38 2011
@@ -724,9 +724,9 @@ public class JexlEngine {
         Object result = null;
         JexlInfo info = debugInfo();
         try {
-            JexlMethod ctor = uberspect.getConstructor(clazz, args, info);
+            JexlMethod ctor = uberspect.getConstructorMethod(clazz, args, info);
             if (ctor == null && arithmetic.narrowArguments(args)) {
-                ctor = uberspect.getConstructor(clazz, args, info);
+                ctor = uberspect.getConstructorMethod(clazz, args, info);
             }
             if (ctor != null) {
                 result = ctor.invoke(clazz, args);

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlException.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlException.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlException.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlException.java Mon
Nov 28 15:37:38 2011
@@ -133,6 +133,7 @@ public class JexlException extends Runti
 
     /**
      * Thrown when tokenization fails.
+     * @since 2.1
      */
     public static class Tokenization extends JexlException {
         /**
@@ -177,6 +178,7 @@ public class JexlException extends Runti
 
     /**
      * Thrown when parsing fails.
+     * @since 2.1
      */
     public static class Parsing extends JexlException {
         /**
@@ -221,6 +223,7 @@ public class JexlException extends Runti
 
     /**
      * Thrown when a variable is unknown.
+     * @since 2.1
      */
     public static class Variable extends JexlException {
         /**
@@ -247,6 +250,7 @@ public class JexlException extends Runti
 
     /**
      * Thrown when a property is unknown.
+     * @since 2.1
      */
     public static class Property extends JexlException {
         /**
@@ -273,6 +277,7 @@ public class JexlException extends Runti
 
     /**
      * Thrown when a method or ctor is unknown, ambiguous or inaccessible.
+     * @since 2.1
      */
     public static class Method extends JexlException {
         /**
@@ -299,6 +304,7 @@ public class JexlException extends Runti
 
     /**
      * Thrown to return a value.
+     * @since 2.1
      */
     protected static class Return extends JexlException {
         /** The returned value. */
@@ -325,6 +331,7 @@ public class JexlException extends Runti
 
     /**
      * Thrown to cancel a script execution.
+     * @since 2.1
      */
     protected static class Cancel extends JexlException {
         /**

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlThreadedArithmetic.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlThreadedArithmetic.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlThreadedArithmetic.java
(original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlThreadedArithmetic.java
Mon Nov 28 15:37:38 2011
@@ -21,6 +21,7 @@ import java.math.MathContext;
 /**
  * A derived arithmetic that allows different threads to operate with
  * different strict/lenient/math modes using the same JexlEngine.
+ * @since 2.1
  */
 public class JexlThreadedArithmetic extends JexlArithmetic {
     

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/NamespaceResolver.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/NamespaceResolver.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/NamespaceResolver.java
(original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/NamespaceResolver.java
Mon Nov 28 15:37:38 2011
@@ -28,6 +28,7 @@ package org.apache.commons.jexl2;
  * JEXL itself reserves 'jexl' and 'ujexl' as namespaces for internal purpose; resolving
those may lead to unexpected
  * results.
  * </p>
+ * @since 2.1
  */
 public interface NamespaceResolver {
     /**

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ObjectContext.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ObjectContext.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ObjectContext.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ObjectContext.java Mon
Nov 28 15:37:38 2011
@@ -19,6 +19,7 @@ package org.apache.commons.jexl2;
 /**
  * Wraps an Object as a Jexl context.
  * @param <T> the wrapped object type to use
+ * @since 2.1
  */
 public class ObjectContext<T> implements JexlContext {
     /** The property solving jexl engine. */

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ReadonlyContext.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ReadonlyContext.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ReadonlyContext.java
(original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/ReadonlyContext.java
Mon Nov 28 15:37:38 2011
@@ -18,6 +18,7 @@ package org.apache.commons.jexl2;
 
 /**
  * A readonly context wrapper.
+ * @since 2.1
  */
 public final class ReadonlyContext implements JexlContext {
     /** The wrapped context. */

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Script.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Script.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Script.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/Script.java Mon Nov 28
15:37:38 2011
@@ -51,6 +51,7 @@ public interface Script {
      * @param args the arguments
      * @return The result of this script, usually the result of 
      *      the last statement.
+     * @since 2.1
      */
     Object execute(JexlContext context, Object... args);
 
@@ -63,12 +64,14 @@ public interface Script {
     /**
      * Gets this script parameters.
      * @return the parameters or null
+     * @since 2.1
      */
     String[] getParameters();
 
     /**
      * Gets this script local variables.
      * @return the local variables or null
+     * @since 2.1
      */
     String[] getLocalVariables();
 
@@ -77,6 +80,7 @@ public interface Script {
      * <p>Note that since variables can be in an ant-ish form (ie foo.bar.quux), each
variable is returned as 
      * a list of strings where each entry is a fragment of the variable ({"foo", "bar", "quux"}
in the example.</p>
      * @return the variables or null
+     * @since 2.1
      */
     Set<List<String>> getVariables();
 
@@ -86,6 +90,7 @@ public interface Script {
      * <p>The interpreter will handle interruption/cancellation gracefully if needed.</p>
      * @param context the context
      * @return the callable
+     * @since 2.1
      */
     Callable<Object> callable(JexlContext context);
 
@@ -96,6 +101,7 @@ public interface Script {
      * @param context the context
      * @param args the script arguments
      * @return the callable
+     * @since 2.1
      */
     Callable<Object> callable(JexlContext context, Object... args);
 }

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/UnifiedJEXL.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/UnifiedJEXL.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/UnifiedJEXL.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/UnifiedJEXL.java Mon
Nov 28 15:37:38 2011
@@ -970,6 +970,7 @@ public final class UnifiedJEXL {
 
     /**
      * Abstract the source fragments, verbatim or immediate typed text blocks.
+     * @since 2.1
      */
     private static final class TemplateBlock {
         /** The type of block, verbatim or directive. */
@@ -1037,6 +1038,7 @@ public final class UnifiedJEXL {
      * and stores the expression array and the writer (java.io.Writer) that the 'jexl:print(...)'
      * delegates the output generation to.
      * </p>
+     * @since 2.1
      */
     public final class Template {
         /** The prefix marker. */
@@ -1193,6 +1195,7 @@ public final class UnifiedJEXL {
      * The type of context to use during evaluation of templates.
      * <p>This context exposes its writer as '$jexl' to the scripts.</p>
      * <p>public for introspection purpose.</p>
+     * @since 2.1
      */
     public final class TemplateContext implements JexlContext, NamespaceResolver {
         /** The wrapped context. */
@@ -1354,6 +1357,7 @@ public final class UnifiedJEXL {
      * @param prefix the directive prefix
      * @param source the source reader
      * @return the list of blocks
+     * @since 2.1
      */
     protected List<TemplateBlock> readTemplate(final String prefix, Reader source)
{
         try {
@@ -1424,6 +1428,7 @@ public final class UnifiedJEXL {
      * @param source the source
      * @param parms the parameter names
      * @return the template
+     * @since 2.1
      */
     public Template createTemplate(String prefix, Reader source, String... parms) {
         return new Template(prefix, source, parms);
@@ -1434,6 +1439,7 @@ public final class UnifiedJEXL {
      * @param source the source
      * @param parms the parameter names
      * @return the template
+     * @since 2.1
      */
     public Template createTemplate(String source, String... parms) {
         return new Template("$$", new StringReader(source), parms);
@@ -1443,6 +1449,7 @@ public final class UnifiedJEXL {
      * Creates a new template.
      * @param source the source
      * @return the template
+     * @since 2.1
      */
     public Template createTemplate(String source) {
         return new Template("$$", new StringReader(source), (String[]) null);

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/Sandbox.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/Sandbox.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/Sandbox.java
(original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/Sandbox.java
Mon Nov 28 15:37:38 2011
@@ -53,7 +53,6 @@ import java.util.Set;
  * <li><b>execute</b> controls executable methods and constructor</li>
  * </ul>
  * </p>
- * 
  * @since 2.1
  */
 public final class Sandbox {

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/SandboxUberspectImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/SandboxUberspectImpl.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/SandboxUberspectImpl.java
(original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/SandboxUberspectImpl.java
Mon Nov 28 15:37:38 2011
@@ -52,7 +52,7 @@ public class SandboxUberspectImpl extend
      * {@inheritDoc}
      */
     @Override
-    public JexlMethod getConstructor(Object ctorHandle, Object[] args, JexlInfo info) {
+    public JexlMethod getConstructorMethod(Object ctorHandle, Object[] args, JexlInfo info)
{
         final String className;
         if (ctorHandle instanceof Class<?>) {
             Class<?> clazz = (Class<?>) ctorHandle;
@@ -63,7 +63,7 @@ public class SandboxUberspectImpl extend
             return null;
         }
         if (sandbox.execute(className, "") != null) {
-            return super.getConstructor(className, args, info);
+            return super.getConstructorMethod(className, args, info);
         }
         return null;
     }

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/Uberspect.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/Uberspect.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/Uberspect.java
(original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/Uberspect.java
Mon Nov 28 15:37:38 2011
@@ -17,6 +17,7 @@
 
 package org.apache.commons.jexl2.introspection;
 
+import java.lang.reflect.Constructor;
 import java.util.Iterator;
 import org.apache.commons.jexl2.JexlInfo;
 
@@ -40,7 +41,19 @@ public interface Uberspect {
      * @param info contextual information
      * @return a {@link Constructor}
      */
-    JexlMethod getConstructor(Object ctorHandle, Object[] args, JexlInfo info);
+    @Deprecated
+    Constructor<?> getConstructor(Object ctorHandle, Object[] args, JexlInfo info);
+    
+    /**
+     * Returns a class constructor wrapped in a JexlMethod.
+     * @param ctorHandle a class or class name
+     * @param args constructor arguments
+     * @param info contextual information
+     * @return a {@link Constructor}
+     * @since 2.1
+     */
+    JexlMethod getConstructorMethod(Object ctorHandle, Object[] args, JexlInfo info);
+    
     /**
      * Returns a JexlMethod.
      * @param obj the object

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/UberspectImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/UberspectImpl.java?rev=1207310&r1=1207309&r2=1207310&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/UberspectImpl.java
(original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/introspection/UberspectImpl.java
Mon Nov 28 15:37:38 2011
@@ -110,7 +110,15 @@ public class UberspectImpl extends Intro
     /**
      * {@inheritDoc}
      */
-    public JexlMethod getConstructor(Object ctorHandle, Object[] args, JexlInfo info) {
+    @Deprecated
+    public Constructor<?> getConstructor(Object ctorHandle, Object[] args, JexlInfo
info) {
+        return getConstructor(ctorHandle, args);
+    }
+    
+    /**
+     * {@inheritDoc}
+     */
+    public JexlMethod getConstructorMethod(Object ctorHandle, Object[] args, JexlInfo info)
{
         final Constructor<?> ctor = getConstructor(ctorHandle, args);
         if (ctor != null) {
             return new ConstructorMethod(ctor);
@@ -191,6 +199,7 @@ public class UberspectImpl extends Intro
      * Abstract an indexed property container.
      * This stores the container name and owning class as well as the list of available getter
and setter methods.
      * It implements JexlPropertyGet since such a container can only be accessed from its
owning instance (not set).
+     * @since 2.1
      */
     private static final class IndexedType implements JexlPropertyGet {
         /** The container name. */
@@ -305,6 +314,7 @@ public class UberspectImpl extends Intro
     /**
      * A generic indexed property container, exposes get(key) and set(key, value) and solves
method call dynamically
      * based on arguments.
+     * @since 2.1
      */
     public static final class IndexedContainer {
         /** The instance owning the container. */
@@ -346,6 +356,7 @@ public class UberspectImpl extends Intro
 
     /**
      * A JexlMethod that wraps constructor.
+     * @since 2.1
      */
     private final class ConstructorMethod implements JexlMethod {
         /** The wrapped constructor. */



Mime
View raw message