You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/07/03 21:51:36 UTC
svn commit: r1499538 - in /tomcat/trunk/java/javax/el: ListELResolver.java
MapELResolver.java MethodExpression.java ValueExpression.java
Author: markt
Date: Wed Jul 3 19:51:36 2013
New Revision: 1499538
URL: http://svn.apache.org/r1499538
Log:
EL 3.0
More cosmetic changes to make API diff smaller
Modified:
tomcat/trunk/java/javax/el/ListELResolver.java
tomcat/trunk/java/javax/el/MapELResolver.java
tomcat/trunk/java/javax/el/MethodExpression.java
tomcat/trunk/java/javax/el/ValueExpression.java
Modified: tomcat/trunk/java/javax/el/ListELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ListELResolver.java?rev=1499538&r1=1499537&r2=1499538&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ListELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ListELResolver.java Wed Jul 3 19:51:36 2013
@@ -40,7 +40,7 @@ public class ListELResolver extends ELRe
}
@Override
- public Object getValue(ELContext context, Object base, Object property) {
+ public Class<?> getType(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException();
}
@@ -50,16 +50,17 @@ public class ListELResolver extends ELRe
List<?> list = (List<?>) base;
int idx = coerce(property);
if (idx < 0 || idx >= list.size()) {
- return null;
+ throw new PropertyNotFoundException(
+ new ArrayIndexOutOfBoundsException(idx).getMessage());
}
- return list.get(idx);
+ return Object.class;
}
return null;
}
@Override
- public Class<?> getType(ELContext context, Object base, Object property) {
+ public Object getValue(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException();
}
@@ -69,10 +70,9 @@ public class ListELResolver extends ELRe
List<?> list = (List<?>) base;
int idx = coerce(property);
if (idx < 0 || idx >= list.size()) {
- throw new PropertyNotFoundException(
- new ArrayIndexOutOfBoundsException(idx).getMessage());
+ return null;
}
- return Object.class;
+ return list.get(idx);
}
return null;
Modified: tomcat/trunk/java/javax/el/MapELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/MapELResolver.java?rev=1499538&r1=1499537&r2=1499538&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/MapELResolver.java (original)
+++ tomcat/trunk/java/javax/el/MapELResolver.java Wed Jul 3 19:51:36 2013
@@ -41,28 +41,28 @@ public class MapELResolver extends ELRes
}
@Override
- public Object getValue(ELContext context, Object base, Object property) {
+ public Class<?> getType(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException();
}
if (base instanceof Map<?,?>) {
context.setPropertyResolved(true);
- return ((Map<?,?>) base).get(property);
+ return Object.class;
}
return null;
}
@Override
- public Class<?> getType(ELContext context, Object base, Object property) {
+ public Object getValue(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException();
}
if (base instanceof Map<?,?>) {
context.setPropertyResolved(true);
- return Object.class;
+ return ((Map<?,?>) base).get(property);
}
return null;
Modified: tomcat/trunk/java/javax/el/MethodExpression.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/MethodExpression.java?rev=1499538&r1=1499537&r2=1499538&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/MethodExpression.java (original)
+++ tomcat/trunk/java/javax/el/MethodExpression.java Wed Jul 3 19:51:36 2013
@@ -20,9 +20,32 @@ public abstract class MethodExpression e
private static final long serialVersionUID = 8163925562047324656L;
- public abstract MethodInfo getMethodInfo(ELContext context) throws NullPointerException, PropertyNotFoundException, MethodNotFoundException, ELException;
+ /**
+ * @throws NullPointerException
+ * If the supplied context is <code>null</code>
+ * @throws PropertyNotFoundException
+ * If a property/variable resolution failed because no match
+ * was found or a match was found but was not readable
+ * @throws MethodNotFoundException
+ * If no matching method can be found
+ * @throws ELException
+ * Wraps any exception throw whilst resolving the property
+ */
+ public abstract MethodInfo getMethodInfo(ELContext context);
- public abstract Object invoke(ELContext context, Object[] params) throws NullPointerException, PropertyNotFoundException, MethodNotFoundException, ELException;
+ /**
+ * @throws NullPointerException
+ * If the supplied context is <code>null</code>
+ * @throws PropertyNotFoundException
+ * If a property/variable resolution failed because no match
+ * was found or a match was found but was not readable
+ * @throws MethodNotFoundException
+ * If no matching method can be found
+ * @throws ELException
+ * Wraps any exception throw whilst resolving the property or
+ * coercion of the result to the expected return type fails
+ */
+ public abstract Object invoke(ELContext context, Object[] params);
/**
* @since EL 3.0
Modified: tomcat/trunk/java/javax/el/ValueExpression.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ValueExpression.java?rev=1499538&r1=1499537&r2=1499538&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ValueExpression.java (original)
+++ tomcat/trunk/java/javax/el/ValueExpression.java Wed Jul 3 19:51:36 2013
@@ -14,23 +14,62 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package javax.el;
-/**
- *
- */
public abstract class ValueExpression extends Expression {
private static final long serialVersionUID = 8577809572381654673L;
- public abstract Object getValue(ELContext context) throws NullPointerException, PropertyNotFoundException, ELException;
+ /**
+ * @throws NullPointerException
+ * If the supplied context is <code>null</code>
+ * @throws PropertyNotFoundException
+ * If a property/variable resolution failed because no match
+ * was found or a match was found but was not readable
+ * @throws ELException
+ * Wraps any exception throw whilst resolving a property or
+ * variable
+ */
+ public abstract Object getValue(ELContext context);
- public abstract void setValue(ELContext context, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException;
+ /**
+ * @throws NullPointerException
+ * If the supplied context is <code>null</code>
+ * @throws PropertyNotFoundException
+ * If a property/variable resolution failed because no match
+ * was found
+ * @throws PropertyNotWritableException
+ * If a property/variable resolution failed because a match was
+ * found but was not writable
+ * @throws ELException
+ * Wraps any exception throw whilst resolving a property or
+ * variable
+ */
+ public abstract void setValue(ELContext context, Object value);
- public abstract boolean isReadOnly(ELContext context) throws NullPointerException, PropertyNotFoundException, ELException;
+ /**
+ * @throws NullPointerException
+ * If the supplied context is <code>null</code>
+ * @throws PropertyNotFoundException
+ * If a property/variable resolution failed because no match
+ * was found or a match was found but was not readable
+ * @throws ELException
+ * Wraps any exception throw whilst resolving a property or
+ * variable
+ */
+ public abstract boolean isReadOnly(ELContext context);
- public abstract Class<?> getType(ELContext context) throws NullPointerException, PropertyNotFoundException, ELException;
+ /**
+ * @throws NullPointerException
+ * If the supplied context is <code>null</code>
+ * @throws PropertyNotFoundException
+ * If a property/variable resolution failed because no match
+ * was found or a match was found but was not readable
+ * @throws ELException
+ * Wraps any exception throw whilst resolving a property or
+ * variable
+ */
+ public abstract Class<?> getType(ELContext context);
public abstract Class<?> getExpectedType();
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org