Javadoc fixes
Signed-off-by: arjantijms <arjan.tijms@gmail.com>
diff --git a/api/src/main/java/javax/el/BeanELResolver.java b/api/src/main/java/javax/el/BeanELResolver.java
index ea4418a..0c64569 100644
--- a/api/src/main/java/javax/el/BeanELResolver.java
+++ b/api/src/main/java/javax/el/BeanELResolver.java
@@ -17,19 +17,19 @@
package javax.el;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.ref.SoftReference;
-import java.lang.ref.ReferenceQueue;
-import java.beans.FeatureDescriptor;
import java.beans.BeanInfo;
+import java.beans.FeatureDescriptor;
+import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
-import java.beans.IntrospectionException;
-import java.util.Iterator;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.SoftReference;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.util.ArrayList;
-import java.util.Map;
import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
@@ -50,14 +50,14 @@
* specified to identify the method. If the parameter types are not
* specified, the parameter objects are used in the method resolution.
* </p>
- *
+ *
* <p>This resolver can be constructed in read-only mode, which means that
- * {@link #isReadOnly} will always return <code>true</code> and
+ * {@link #isReadOnly} will always return <code>true</code> and
* {@link #setValue} will always throw
* <code>PropertyNotWritableException</code>.</p>
*
- * <p><code>ELResolver</code>s are combined together using
- * {@link CompositeELResolver}s, to define rich semantics for evaluating
+ * <p><code>ELResolver</code>s are combined together using
+ * {@link CompositeELResolver}s, to define rich semantics for evaluating
* an expression. See the javadocs for {@link ELResolver} for details.</p>
*
* <p>Because this resolver handles base objects of any type, it should
@@ -142,31 +142,31 @@
private Method readMethod;
private Method writeMethod;
private PropertyDescriptor descriptor;
-
+
public BeanProperty(Class<?> baseClass,
PropertyDescriptor descriptor) {
this.descriptor = descriptor;
readMethod = ELUtil.getMethod(baseClass, descriptor.getReadMethod());
writeMethod = ELUtil.getMethod(baseClass, descriptor.getWriteMethod());
}
-
+
public Class getPropertyType() {
return descriptor.getPropertyType();
}
-
+
public boolean isReadOnly() {
return getWriteMethod() == null;
}
-
+
public Method getReadMethod() {
return readMethod;
}
-
+
public Method getWriteMethod() {
return writeMethod;
}
}
-
+
/*
* Defines the properties for a bean.
*/
@@ -174,7 +174,7 @@
private final Map<String, BeanProperty> propertyMap =
new HashMap<String, BeanProperty>();
-
+
public BeanProperties(Class<?> baseClass) {
PropertyDescriptor[] descriptors;
try {
@@ -188,7 +188,7 @@
new BeanProperty(baseClass, pd));
}
}
-
+
public BeanProperty getBeanProperty(String property) {
return propertyMap.get(property);
}
@@ -213,13 +213,13 @@
}
/**
- * If the base object is not <code>null</code>, returns the most
+ * If the base object is not <code>null</code>, returns the most
* general acceptable type that can be set on this bean property.
*
- * <p>If the base is not <code>null</code>, the
+ * <p>If the base is not <code>null</code>, the
* <code>propertyResolved</code> property of the <code>ELContext</code>
* object must be set to <code>true</code> by this resolver, before
- * returning. If this property is not <code>true</code> after this
+ * returning. If this property is not <code>true</code> after this
* method is called, the caller should ignore the return value.</p>
*
* <p>The provided property will first be coerced to a <code>String</code>.
@@ -232,7 +232,7 @@
* @param base The bean to analyze.
* @param property The name of the property to analyze. Will be coerced to
* a <code>String</code>.
- * @return If the <code>propertyResolved</code> property of
+ * @return If the <code>propertyResolved</code> property of
* <code>ELContext</code> was set to <code>true</code>, then
* the most general acceptable type; otherwise undefined.
* @throws NullPointerException if context is <code>null</code>
@@ -244,6 +244,7 @@
* must be included as the cause property of this exception, if
* available.
*/
+ @Override
public Class<?> getType(ELContext context,
Object base,
Object property) {
@@ -265,24 +266,24 @@
* If the base object is not <code>null</code>, returns the current
* value of the given property on this bean.
*
- * <p>If the base is not <code>null</code>, the
+ * <p>If the base is not <code>null</code>, the
* <code>propertyResolved</code> property of the <code>ELContext</code>
* object must be set to <code>true</code> by this resolver, before
- * returning. If this property is not <code>true</code> after this
+ * returning. If this property is not <code>true</code> after this
* method is called, the caller should ignore the return value.</p>
*
* <p>The provided property name will first be coerced to a
- * <code>String</code>. If the property is a readable property of the
- * base object, as per the JavaBeans specification, then return the
- * result of the getter call. If the getter throws an exception,
- * it is propagated to the caller. If the property is not found or is
+ * <code>String</code>. If the property is a readable property of the
+ * base object, as per the JavaBeans specification, then return the
+ * result of the getter call. If the getter throws an exception,
+ * it is propagated to the caller. If the property is not found or is
* not readable, a <code>PropertyNotFoundException</code> is thrown.</p>
*
* @param context The context of this evaluation.
* @param base The bean on which to get the property.
* @param property The name of the property to get. Will be coerced to
* a <code>String</code>.
- * @return If the <code>propertyResolved</code> property of
+ * @return If the <code>propertyResolved</code> property of
* <code>ELContext</code> was set to <code>true</code>, then
* the value of the given property. Otherwise, undefined.
* @throws NullPointerException if context is <code>null</code>.
@@ -294,6 +295,7 @@
* must be included as the cause property of this exception, if
* available.
*/
+ @Override
public Object getValue(ELContext context,
Object base,
Object property) {
@@ -334,18 +336,18 @@
* If the base object is not <code>null</code>, attempts to set the
* value of the given property on this bean.
*
- * <p>If the base is not <code>null</code>, the
+ * <p>If the base is not <code>null</code>, the
* <code>propertyResolved</code> property of the <code>ELContext</code>
* object must be set to <code>true</code> by this resolver, before
- * returning. If this property is not <code>true</code> after this
+ * returning. If this property is not <code>true</code> after this
* method is called, the caller can safely assume no value was set.</p>
*
* <p>If this resolver was constructed in read-only mode, this method will
* always throw <code>PropertyNotWritableException</code>.</p>
*
* <p>The provided property name will first be coerced to a
- * <code>String</code>. If property is a writable property of
- * <code>base</code> (as per the JavaBeans Specification), the setter
+ * <code>String</code>. If property is a writable property of
+ * <code>base</code> (as per the JavaBeans Specification), the setter
* method is called (passing <code>value</code>). If the property exists
* but does not have a setter, then a
* <code>PropertyNotFoundException</code> is thrown. If the property
@@ -366,6 +368,7 @@
* must be included as the cause property of this exception, if
* available.
*/
+ @Override
public void setValue(ELContext context,
Object base,
Object property,
@@ -384,7 +387,7 @@
ELUtil.getExceptionMessageString(context,
"resolverNotwritable",
new Object[] { base.getClass().getName() }));
- }
+ }
BeanProperty bp = getBeanProperty(context, base, property);
Method method = bp.getWriteMethod();
@@ -427,7 +430,7 @@
* method is called, the caller should ignore the return value.</p>
*
* <p>The provided method object will first be coerced to a
- * <code>String</code>. The methods in the bean is then examined and
+ * <code>String</code>. The methods in the bean is then examined and
* an attempt will be made to select one for invocation. If no suitable
* can be found, a <code>MethodNotFoundException</code> is thrown.
*
@@ -473,6 +476,7 @@
* @since EL 2.2
*/
+ @Override
public Object invoke(ELContext context,
Object base,
Object method,
@@ -500,17 +504,17 @@
* If the base object is not <code>null</code>, returns whether a call
* to {@link #setValue} will always fail.
*
- * <p>If the base is not <code>null</code>, the
+ * <p>If the base is not <code>null</code>, the
* <code>propertyResolved</code> property of the <code>ELContext</code>
* object must be set to <code>true</code> by this resolver, before
- * returning. If this property is not <code>true</code> after this
+ * returning. If this property is not <code>true</code> after this
* method is called, the caller can safely assume no value was set.</p>
*
* <p>If this resolver was constructed in read-only mode, this method will
* always return <code>true</code>.</p>
*
* <p>The provided property name will first be coerced to a
- * <code>String</code>. If property is a writable property of
+ * <code>String</code>. If property is a writable property of
* <code>base</code>, <code>false</code> is returned. If the property is
* found but is not writable, <code>true</code> is returned. If the
* property is not found, a <code>PropertyNotFoundException</code>
@@ -520,7 +524,7 @@
* @param base The bean to analyze.
* @param property The name of the property to analyzed. Will be coerced to
* a <code>String</code>.
- * @return If the <code>propertyResolved</code> property of
+ * @return If the <code>propertyResolved</code> property of
* <code>ELContext</code> was set to <code>true</code>, then
* <code>true</code> if calling the <code>setValue</code> method
* will always fail or <code>false</code> if it is possible that
@@ -533,6 +537,7 @@
* must be included as the cause property of this exception, if
* available.
*/
+ @Override
public boolean isReadOnly(ELContext context,
Object base,
Object property) {
@@ -559,28 +564,29 @@
* <code>Iterator</code> containing the set of JavaBeans properties
* available on the given object. Otherwise, returns <code>null</code>.
*
- * <p>The <code>Iterator</code> returned must contain zero or more
- * instances of {@link java.beans.FeatureDescriptor}. Each info object
+ * <p>The <code>Iterator</code> returned must contain zero or more
+ * instances of {@link java.beans.FeatureDescriptor}. Each info object
* contains information about a property in the bean, as obtained by
* calling the <code>BeanInfo.getPropertyDescriptors</code> method.
* The <code>FeatureDescriptor</code> is initialized using the same
* fields as are present in the <code>PropertyDescriptor</code>,
- * with the additional required named attributes "<code>type</code>" and
+ * with the additional required named attributes "<code>type</code>" and
* "<code>resolvableAtDesignTime</code>" set as follows:
- * <dl>
+ * <ul>
* <li>{@link ELResolver#TYPE} - The runtime type of the property, from
* <code>PropertyDescriptor.getPropertyType()</code>.</li>
* <li>{@link ELResolver#RESOLVABLE_AT_DESIGN_TIME} - <code>true</code>.</li>
- * </dl>
- * </p>
- *
+ * </ul>
+ *
+ *
* @param context The context of this evaluation.
* @param base The bean to analyze.
- * @return An <code>Iterator</code> containing zero or more
+ * @return An <code>Iterator</code> containing zero or more
* <code>FeatureDescriptor</code> objects, each representing a property
* on this bean, or <code>null</code> if the <code>base</code>
* object is <code>null</code>.
*/
+ @Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(
ELContext context,
Object base) {
@@ -607,8 +613,8 @@
}
/**
- * If the base object is not <code>null</code>, returns the most
- * general type that this resolver accepts for the
+ * If the base object is not <code>null</code>, returns the most
+ * general type that this resolver accepts for the
* <code>property</code> argument. Otherwise, returns <code>null</code>.
*
* <p>Assuming the base is not <code>null</code>, this method will always
@@ -620,6 +626,7 @@
* @return <code>null</code> if base is <code>null</code>; otherwise
* <code>Object.class</code>.
*/
+ @Override
public Class<?> getCommonPropertyType(ELContext context,
Object base) {
if (base == null){
diff --git a/api/src/main/java/javax/el/BeanNameELResolver.java b/api/src/main/java/javax/el/BeanNameELResolver.java
index 2fc92f8..f654826 100644
--- a/api/src/main/java/javax/el/BeanNameELResolver.java
+++ b/api/src/main/java/javax/el/BeanNameELResolver.java
@@ -16,16 +16,17 @@
package javax.el;
-import java.util.Iterator;
import java.beans.FeatureDescriptor;
+import java.util.Iterator;
/**
* <p>An <code>ELResolver</code> for resolving user or container managed beans.</p>
* <p>A {@link BeanNameResolver} is required for its proper operation.
- * The following example creates an <code>ELResolver</code> that
+ * The following example creates an <code>ELResolver</code> that
* resolves the name "bean" to an instance of MyBean.
- * <blockquote>
+ *
* <pre>
+ * <code>
* ELResovler elr = new BeanNameELResolver(new BeanNameResolver {
* public boolean isNameResolved(String beanName) {
* return "bean".equals(beanName);
@@ -34,9 +35,9 @@
* return "bean".equals(beanName)? new MyBean(): null;
* }
* });
+ * </code>
* </pre>
- * </blockquote>
- * </p>
+ *
* @since EL 3.0
*/
public class BeanNameELResolver extends ELResolver {
@@ -209,12 +210,13 @@
}
/**
- * Always returns <code>null</code>, since there is no reason to
+ * Always returns <code>null</code>, since there is no reason to
* iterate through a list of one element: bean name.
* @param context The context of this evaluation.
* @param base <code>null</code>.
* @return <code>null</code>.
*/
+ @Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(
ELContext context, Object base) {
return null;
diff --git a/api/src/main/java/javax/el/CompositeELResolver.java b/api/src/main/java/javax/el/CompositeELResolver.java
index 2c46e33..554c80a 100644
--- a/api/src/main/java/javax/el/CompositeELResolver.java
+++ b/api/src/main/java/javax/el/CompositeELResolver.java
@@ -17,9 +17,8 @@
package javax.el;
-import java.util.ArrayList;
-import java.util.Iterator;
import java.beans.FeatureDescriptor;
+import java.util.Iterator;
/**
* Maintains an ordered composite list of child <code>ELResolver</code>s.
@@ -36,18 +35,18 @@
* most resolvers will only handle a <code>base</code> of a single type.
* To indicate that a resolver has successfully resolved a particular
* (base, property) pair, it must set the <code>propertyResolved</code>
- * property of the <code>ELContext</code> to <code>true</code>. If it could
+ * property of the <code>ELContext</code> to <code>true</code>. If it could
* not handle the given pair, it must leave this property alone. The caller
* must ignore the return value of the method if <code>propertyResolved</code>
* is <code>false</code>.</p>
*
* <p>The <code>CompositeELResolver</code> initializes the
- * <code>ELContext.propertyResolved</code> flag to <code>false</code>, and uses
+ * <code>ELContext.propertyResolved</code> flag to <code>false</code>, and uses
* it as a stop condition for iterating through its component resolvers.</p>
*
- * <p>The <code>ELContext.propertyResolved</code> flag is not used for the
+ * <p>The <code>ELContext.propertyResolved</code> flag is not used for the
* design-time methods {@link #getFeatureDescriptors} and
- * {@link #getCommonPropertyType}. Instead, results are collected and
+ * {@link #getCommonPropertyType}. Instead, results are collected and
* combined from all child <code>ELResolver</code>s for these methods.</p>
*
* @see ELContext
@@ -89,41 +88,41 @@
* Attempts to resolve the given <code>property</code> object on the given
* <code>base</code> object by querying all component resolvers.
*
- * <p>If this resolver handles the given (base, property) pair,
- * the <code>propertyResolved</code> property of the
+ * <p>If this resolver handles the given (base, property) pair,
+ * the <code>propertyResolved</code> property of the
* <code>ELContext</code> object must be set to <code>true</code>
- * by the resolver, before returning. If this property is not
- * <code>true</code> after this method is called, the caller should ignore
- * the return value.</p>
+ * by the resolver, before returning. If this property is not
+ * <code>true</code> after this method is called, the caller should ignore
+ * the return value.
*
* <p>First, <code>propertyResolved</code> is set to <code>false</code> on
- * the provided <code>ELContext</code>.</p>
+ * the provided <code>ELContext</code>.
*
* <p>Next, for each component resolver in this composite:
* <ol>
* <li>The <code>getValue()</code> method is called, passing in
- * the provided <code>context</code>, <code>base</code> and
+ * the provided <code>context</code>, <code>base</code> and
* <code>property</code>.</li>
* <li>If the <code>ELContext</code>'s <code>propertyResolved</code>
* flag is <code>false</code> then iteration continues.</li>
* <li>Otherwise, iteration stops and no more component resolvers are
* considered. The value returned by <code>getValue()</code> is
* returned by this method.</li>
- * </ol></p>
+ * </ol>
*
* <p>If none of the component resolvers were able to perform this
* operation, the value <code>null</code> is returned and the
- * <code>propertyResolved</code> flag remains set to
- * <code>false</code></p>.
+ * <code>propertyResolved</code> flag remains set to
+ * <code>false</code>.
*
* <p>Any exception thrown by component resolvers during the iteration
- * is propagated to the caller of this method.</p>
+ * is propagated to the caller of this method.
*
* @param context The context of this evaluation.
* @param base The base object whose property value is to be returned,
* or <code>null</code> to resolve a top-level variable.
* @param property The property or variable to be resolved.
- * @return If the <code>propertyResolved</code> property of
+ * @return If the <code>propertyResolved</code> property of
* <code>ELContext</code> was set to <code>true</code>, then
* the result of the variable or property resolution; otherwise
* undefined.
@@ -136,19 +135,20 @@
* must be included as the cause property of this exception, if
* available.
*/
+ @Override
public Object getValue(ELContext context,
Object base,
Object property) {
context.setPropertyResolved(false);
- Object value = null;
+ Object value = null;
for (int i = 0; i < size; i++) {
value = elResolvers[i].getValue(context, base, property);
if (context.isPropertyResolved()) {
return value;
}
- }
+ }
return null;
}
@@ -177,7 +177,7 @@
* <li>Otherwise, iteration stops and no more component resolvers are
* considered. The value returned by <code>getValue()</code> is
* returned by this method.</li>
- * </ol></p>
+ * </ol>
*
* <p>If none of the component resolvers were able to perform this
* operation, the value <code>null</code> is returned and the
@@ -202,6 +202,7 @@
* the method has a <code>void</code> return type).
* @since EL 2.2
*/
+ @Override
public Object invoke(ELContext context,
Object base,
Object method,
@@ -223,16 +224,16 @@
/**
* For a given <code>base</code> and <code>property</code>, attempts to
- * identify the most general type that is acceptable for an object to be
- * passed as the <code>value</code> parameter in a future call
- * to the {@link #setValue} method. The result is obtained by
+ * identify the most general type that is acceptable for an object to be
+ * passed as the <code>value</code> parameter in a future call
+ * to the {@link #setValue} method. The result is obtained by
* querying all component resolvers.
*
- * <p>If this resolver handles the given (base, property) pair,
- * the <code>propertyResolved</code> property of the
+ * <p>If this resolver handles the given (base, property) pair,
+ * the <code>propertyResolved</code> property of the
* <code>ELContext</code> object must be set to <code>true</code>
- * by the resolver, before returning. If this property is not
- * <code>true</code> after this method is called, the caller should ignore
+ * by the resolver, before returning. If this property is not
+ * <code>true</code> after this method is called, the caller should ignore
* the return value.</p>
*
* <p>First, <code>propertyResolved</code> is set to <code>false</code> on
@@ -241,18 +242,18 @@
* <p>Next, for each component resolver in this composite:
* <ol>
* <li>The <code>getType()</code> method is called, passing in
- * the provided <code>context</code>, <code>base</code> and
+ * the provided <code>context</code>, <code>base</code> and
* <code>property</code>.</li>
* <li>If the <code>ELContext</code>'s <code>propertyResolved</code>
* flag is <code>false</code> then iteration continues.</li>
* <li>Otherwise, iteration stops and no more component resolvers are
* considered. The value returned by <code>getType()</code> is
* returned by this method.</li>
- * </ol></p>
+ * </ol>
*
* <p>If none of the component resolvers were able to perform this
* operation, the value <code>null</code> is returned and the
- * <code>propertyResolved</code> flag remains set to
+ * <code>propertyResolved</code> flag remains set to
* <code>false</code></p>.
*
* <p>Any exception thrown by component resolvers during the iteration
@@ -261,9 +262,9 @@
* @param context The context of this evaluation.
* @param base The base object whose property value is to be analyzed,
* or <code>null</code> to analyze a top-level variable.
- * @param property The property or variable to return the acceptable
+ * @param property The property or variable to return the acceptable
* type for.
- * @return If the <code>propertyResolved</code> property of
+ * @return If the <code>propertyResolved</code> property of
* <code>ELContext</code> was set to <code>true</code>, then
* the most general acceptable type; otherwise undefined.
* @throws NullPointerException if context is <code>null</code>
@@ -275,13 +276,14 @@
* must be included as the cause property of this exception, if
* available.
*/
+ @Override
public Class<?> getType(ELContext context,
Object base,
Object property) {
context.setPropertyResolved(false);
- Class<?> type;
+ Class<?> type;
for (int i = 0; i < size; i++) {
type = elResolvers[i].getType(context, base, property);
if (context.isPropertyResolved()) {
@@ -292,37 +294,40 @@
}
/**
- * Attempts to set the value of the given <code>property</code>
+ * Attempts to set the value of the given <code>property</code>
* object on the given <code>base</code> object. All component
* resolvers are asked to attempt to set the value.
*
- * <p>If this resolver handles the given (base, property) pair,
- * the <code>propertyResolved</code> property of the
+ * <p>
+ * If this resolver handles the given (base, property) pair,
+ * the <code>propertyResolved</code> property of the
* <code>ELContext</code> object must be set to <code>true</code>
- * by the resolver, before returning. If this property is not
+ * by the resolver, before returning. If this property is not
* <code>true</code> after this method is called, the caller can
- * safely assume no value has been set.</p>
+ * safely assume no value has been set.
*
- * <p>First, <code>propertyResolved</code> is set to <code>false</code> on
- * the provided <code>ELContext</code>.</p>
+ * <p>
+ * First, <code>propertyResolved</code> is set to <code>false</code> on
+ * the provided <code>ELContext</code>.
*
- * <p>Next, for each component resolver in this composite:
+ * <p>
+ * Next, for each component resolver in this composite:
* <ol>
* <li>The <code>setValue()</code> method is called, passing in
- * the provided <code>context</code>, <code>base</code>,
+ * the provided <code>context</code>, <code>base</code>,
* <code>property</code> and <code>value</code>.</li>
* <li>If the <code>ELContext</code>'s <code>propertyResolved</code>
* flag is <code>false</code> then iteration continues.</li>
* <li>Otherwise, iteration stops and no more component resolvers are
* considered.</li>
- * </ol></p>
+ * </ol>
*
* <p>If none of the component resolvers were able to perform this
- * operation, the <code>propertyResolved</code> flag remains set to
- * <code>false</code></p>.
+ * operation, the <code>propertyResolved</code> flag remains set to
+ * <code>false</code>.
*
* <p>Any exception thrown by component resolvers during the iteration
- * is propagated to the caller of this method.</p>
+ * is propagated to the caller of this method.
*
* @param context The context of this evaluation.
* @param base The base object whose property value is to be set,
@@ -341,6 +346,7 @@
* must be included as the cause property of this exception, if
* available.
*/
+ @Override
public void setValue(ELContext context,
Object base,
Object property,
@@ -361,11 +367,11 @@
* determine whether a call to {@link #setValue} will always fail. The
* result is obtained by querying all component resolvers.
*
- * <p>If this resolver handles the given (base, property) pair,
- * the <code>propertyResolved</code> property of the
+ * <p>If this resolver handles the given (base, property) pair,
+ * the <code>propertyResolved</code> property of the
* <code>ELContext</code> object must be set to <code>true</code>
- * by the resolver, before returning. If this property is not
- * <code>true</code> after this method is called, the caller should ignore
+ * by the resolver, before returning. If this property is not
+ * <code>true</code> after this method is called, the caller should ignore
* the return value.</p>
*
* <p>First, <code>propertyResolved</code> is set to <code>false</code> on
@@ -374,18 +380,18 @@
* <p>Next, for each component resolver in this composite:
* <ol>
* <li>The <code>isReadOnly()</code> method is called, passing in
- * the provided <code>context</code>, <code>base</code> and
+ * the provided <code>context</code>, <code>base</code> and
* <code>property</code>.</li>
* <li>If the <code>ELContext</code>'s <code>propertyResolved</code>
* flag is <code>false</code> then iteration continues.</li>
* <li>Otherwise, iteration stops and no more component resolvers are
* considered. The value returned by <code>isReadOnly()</code> is
* returned by this method.</li>
- * </ol></p>
+ * </ol>
*
* <p>If none of the component resolvers were able to perform this
* operation, the value <code>false</code> is returned and the
- * <code>propertyResolved</code> flag remains set to
+ * <code>propertyResolved</code> flag remains set to
* <code>false</code></p>.
*
* <p>Any exception thrown by component resolvers during the iteration
@@ -396,7 +402,7 @@
* or <code>null</code> to analyze a top-level variable.
* @param property The property or variable to return the read-only status
* for.
- * @return If the <code>propertyResolved</code> property of
+ * @return If the <code>propertyResolved</code> property of
* <code>ELContext</code> was set to <code>true</code>, then
* <code>true</code> if the property is read-only or
* <code>false</code> if not; otherwise undefined.
@@ -409,6 +415,7 @@
* must be included as the cause property of this exception, if
* available.
*/
+ @Override
public boolean isReadOnly(ELContext context,
Object base,
Object property) {
@@ -426,31 +433,32 @@
}
/**
- * Returns information about the set of variables or properties that
+ * Returns information about the set of variables or properties that
* can be resolved for the given <code>base</code> object. One use for
* this method is to assist tools in auto-completion. The results are
* collected from all component resolvers.
*
- * <p>The <code>propertyResolved</code> property of the
+ * <p>The <code>propertyResolved</code> property of the
* <code>ELContext</code> is not relevant to this method.
* The results of all <code>ELResolver</code>s are concatenated.</p>
*
* <p>The <code>Iterator</code> returned is an iterator over the
* collection of <code>FeatureDescriptor</code> objects returned by
- * the iterators returned by each component resolver's
- * <code>getFeatureDescriptors</code> method. If <code>null</code> is
+ * the iterators returned by each component resolver's
+ * <code>getFeatureDescriptors</code> method. If <code>null</code> is
* returned by a resolver, it is skipped.</p>
- *
+ *
* @param context The context of this evaluation.
* @param base The base object whose set of valid properties is to
* be enumerated, or <code>null</code> to enumerate the set of
* top-level variables that this resolver can evaluate.
* @return An <code>Iterator</code> containing zero or more (possibly
- * infinitely more) <code>FeatureDescriptor</code> objects, or
- * <code>null</code> if this resolver does not handle the given
- * <code>base</code> object or that the results are too complex to
+ * infinitely more) <code>FeatureDescriptor</code> objects, or
+ * <code>null</code> if this resolver does not handle the given
+ * <code>base</code> object or that the results are too complex to
* represent with this method
*/
+ @Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(
ELContext context,
Object base) {
@@ -465,7 +473,7 @@
*
* <p>The <code>Class</code> returned is the most specific class that is
* a common superclass of all the classes returned by each component
- * resolver's <code>getCommonPropertyType</code> method. If
+ * resolver's <code>getCommonPropertyType</code> method. If
* <code>null</code> is returned by a resolver, it is skipped.</p>
*
* @param context The context of this evaluation.
@@ -478,6 +486,7 @@
* is accepted; otherwise the most general <code>property</code>
* type accepted for the given <code>base</code>.
*/
+ @Override
public Class<?> getCommonPropertyType(ELContext context,
Object base) {
Class<?> commonPropertyType = null;
@@ -554,6 +563,7 @@
this.base = base;
}
+ @Override
public boolean hasNext() {
if (propertyIter == null || !propertyIter.hasNext()) {
while (index < size) {
@@ -569,6 +579,7 @@
return propertyIter.hasNext();
}
+ @Override
public FeatureDescriptor next() {
if (propertyIter == null || !propertyIter.hasNext()) {
while (index < size) {
@@ -584,6 +595,7 @@
return propertyIter.next();
}
+ @Override
public void remove() {
throw new UnsupportedOperationException();
}
diff --git a/api/src/main/java/javax/el/ELContext.java b/api/src/main/java/javax/el/ELContext.java
index 7bc26da..a99c720 100644
--- a/api/src/main/java/javax/el/ELContext.java
+++ b/api/src/main/java/javax/el/ELContext.java
@@ -17,12 +17,12 @@
package javax.el;
-import java.util.Map;
-import java.util.Stack;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
-import java.util.ArrayList;
import java.util.Locale;
+import java.util.Map;
+import java.util.Stack;
/**
* Context information for expression parsing and evaluation.
@@ -36,7 +36,7 @@
* to resolve EL Variables. This is used only in parsing.</li>
* <li>a reference to the base {@link ELResolver} that will be consulted
* to resolve model objects and their properties</li>
- * <li>a collection of all the relevant context objects for use by
+ * <li>a collection of all the relevant context objects for use by
* <code>ELResolver</code>s</li>
* <li>state information during the evaluation of an expression, such as
* whether a property has been resolved yet</li>
@@ -44,30 +44,34 @@
* resolve classes that have been imported</li>
* <li>a reference to the arguments for the active {@link LambdaExpression}s</li>
* <li>a reference to the list of registered evaluation listeners</li>
- * </ul></p>
+ * </ul>
*
- * <p>The collection of context objects is necessary because each
+ * <p>
+ * The collection of context objects is necessary because each
* <code>ELResolver</code> may need access to a different context object.
- * For example, JSP and Faces resolvers need access to a
+ * For example, JSP and Faces resolvers need access to a
* {@link javax.servlet.jsp.JspContext} and a
- * {@link javax.faces.context.FacesContext}, respectively.</p>
+ * {@link javax.faces.context.FacesContext}, respectively.
*
- * <p>When used in a web container, the creation of
- * <code>ELContext</code> objects is controlled through
+ * <p>
+ * When used in a web container, the creation of
+ * <code>ELContext</code> objects is controlled through
* the underlying technology. For example, in JSP the
* <code>JspContext.getELContext()</code> factory method is used.
* Some technologies provide the ability to add an {@link ELContextListener}
* so that applications and frameworks can ensure their own context objects
- * are attached to any newly created <code>ELContext</code>.</p>
+ * are attached to any newly created <code>ELContext</code>.
*
- * <p>When used in a stand-alone environment, {@link StandardELContext}
+ * <p>
+ * When used in a stand-alone environment, {@link StandardELContext}
* provides a default <code>ELContext</code>, which is managed and modified
* by {@link ELManager}.
*
- * <p>Because it stores state during expression evaluation, an
+ * <p>
+ * Because it stores state during expression evaluation, an
* <code>ELContext</code> object is not thread-safe. Care should be taken
- * to never share an <code>ELContext</code> instance between two or more
- * threads.</p>
+ * to never share an <code>ELContext</code> instance between two or more
+ * threads.
*
* @see ELContextListener
* @see ELContextEvent
@@ -165,8 +169,8 @@
* are used by <code>ELResolver</code>s. This method is used to
* retrieve the context with the given key from the collection.</p>
*
- * <p>By convention, the object returned will be of the type specified by
- * the <code>key</code>. However, this is not required and the key is
+ * <p>By convention, the object returned will be of the type specified by
+ * the <code>key</code>. However, this is not required and the key is
* used strictly as a unique identifier.</p>
*
* @param key The unique identifier that was used to associate the
@@ -181,11 +185,11 @@
}
return map.get(key);
}
-
+
/**
* Retrieves the <code>ELResolver</code> associated with this context.
*
- * <p>The <code>ELContext</code> maintains a reference to the
+ * <p>The <code>ELContext</code> maintains a reference to the
* <code>ELResolver</code> that will be consulted to resolve variables
* and properties during an expression evaluation. This method
* retrieves the reference to the resolver.</p>
@@ -197,7 +201,7 @@
* property resolution during expression evaluation.
*/
public abstract ELResolver getELResolver();
-
+
/**
* Retrieves the <code>ImportHandler</code> associated with this
* <code>ELContext</code>.
@@ -213,23 +217,23 @@
}
/**
- * Retrieves the <code>FunctionMapper</code> associated with this
+ * Retrieves the <code>FunctionMapper</code> associated with this
* <code>ELContext</code>.
*
* @return The function mapper to be consulted for the resolution of
* EL functions.
*/
public abstract FunctionMapper getFunctionMapper();
-
+
/**
* Holds value of property locale.
*/
private Locale locale;
-
+
/**
- * Get the <code>Locale</code> stored by a previous invocation to
+ * Get the <code>Locale</code> stored by a previous invocation to
* {@link #setLocale}. If this method returns non <code>null</code>,
- * this <code>Locale</code> must be used for all localization needs
+ * this <code>Locale</code> must be used for all localization needs
* in the implementation. The <code>Locale</code> must not be cached
* to allow for applications that change <code>Locale</code> dynamically.
*
@@ -243,20 +247,25 @@
}
/**
- * Sets the <code>Locale</code> for this instance. This method may be
+ * Sets the <code>Locale</code> for this instance.
+ *
+ * <p>
+ * This method may be
* called by the party creating the instance, such as JavaServer
* Faces or JSP, to enable the EL implementation to provide localized
* messages to the user. If no <code>Locale</code> is set, the implementation
* must use the locale returned by <code>Locale.getDefault( )</code>.
+ *
+ * @param locale the locale for this instance
*/
public void setLocale(Locale locale) {
this.locale = locale;
- }
-
-
+ }
+
+
/**
- * Retrieves the <code>VariableMapper</code> associated with this
+ * Retrieves the <code>VariableMapper</code> associated with this
* <code>ELContext</code>.
*
* @return The variable mapper to be consulted for the resolution of
@@ -352,7 +361,7 @@
* then searched, and so on.
*
* @param arg The formal parameter for the Lambda argument
- * @return The object associated with formal parameter. Null if
+ * @return The object associated with formal parameter. Null if
* no object has been associated with the parameter.
* @since EL 3.0
*/
@@ -402,10 +411,11 @@
* the standard coercions is applied.
*
* <p>An <code>ELException</code> is thrown if an error occurs during
- * the conversion.</p>
+ * the conversion.
*
* @param obj The object to convert.
* @param targetType The target type for the conversion.
+ * @return object converted to <code>targetType</code>
* @throws ELException thrown if errors occur.
*
* @since EL 3.0
diff --git a/api/src/main/java/javax/el/ELManager.java b/api/src/main/java/javax/el/ELManager.java
index 5d06e22..de54777 100644
--- a/api/src/main/java/javax/el/ELManager.java
+++ b/api/src/main/java/javax/el/ELManager.java
@@ -80,7 +80,7 @@
* Can be called multiple times. The new ELResolver is
* placed ahead of the default ELResolvers. The list of the ELResolvers
* added this way are ordered chronologically.
- *
+ *
* @param elr The ELResolver to be added to the list of ELResolvers in
* ELContext.
* @see StandardELContext#addELResolver
@@ -92,14 +92,14 @@
/**
* Maps a static method to an EL function.
* @param prefix The namespace of the functions, can be "".
- * @param function The name of the function.
+ * @param function The name of the function.
* @param meth The static method to be invoked when the function is used.
*/
public void mapFunction(String prefix, String function, Method meth) {
getELContext().getFunctionMapper().mapFunction(prefix, function, meth);
}
- /**
+ /**
* Assign a ValueExpression to an EL variable, replacing
* any previous assignment to the same variable.
* The assignment for the variable is removed if
@@ -149,6 +149,7 @@
* @param name The name of the bean
* @param bean The bean instance to be defined. If null, the definition
* of the bean is removed.
+ * @return the previous bean (if any) mapped to <code>name</code>
*/
public Object defineBean(String name, Object bean) {
Object ret = getELContext().getBeans().get(name);
diff --git a/api/src/main/java/javax/el/ELResolver.java b/api/src/main/java/javax/el/ELResolver.java
index 29a74f9..62300b7 100644
--- a/api/src/main/java/javax/el/ELResolver.java
+++ b/api/src/main/java/javax/el/ELResolver.java
@@ -17,28 +17,28 @@
package javax.el;
-import java.util.Iterator;
import java.beans.FeatureDescriptor;
+import java.util.Iterator;
/**
* Enables customization of variable, property, method call, and type
* conversion resolution behavior for EL expression evaluation.
*
* <p>While evaluating an expression, the <code>ELResolver</code> associated
- * with the {@link ELContext} is consulted to do the initial resolution of
- * the first variable of an expression. It is also consulted when a
+ * with the {@link ELContext} is consulted to do the initial resolution of
+ * the first variable of an expression. It is also consulted when a
* <code>.</code> or <code>[]</code> operator is encountered.
*
- * <p>For example, in the EL expression <code>${employee.lastName}</code>,
+ * <p>For example, in the EL expression <code>${employee.lastName}</code>,
* the <code>ELResolver</code> determines what object <code>employee</code>
- * refers to, and what it means to get the <code>lastName</code> property on
+ * refers to, and what it means to get the <code>lastName</code> property on
* that object.</p>
*
- * <p>Most methods in this class accept a <code>base</code>
+ * <p>Most methods in this class accept a <code>base</code>
* and <code>property</code> parameter. In the case of variable resolution
- * (e.g. determining what <code>employee</code> refers to in
- * <code>${employee.lastName}</code>), the <code>base</code> parameter will
- * be <code>null</code> and the <code>property</code> parameter will always
+ * (e.g. determining what <code>employee</code> refers to in
+ * <code>${employee.lastName}</code>), the <code>base</code> parameter will
+ * be <code>null</code> and the <code>property</code> parameter will always
* be of type <code>String</code>. In this case, if the <code>property</code>
* is not a <code>String</code>, the behavior of the <code>ELResolver</code>
* is undefined.</p>
@@ -77,7 +77,7 @@
* most resolvers will only handle a <code>base</code> of a single type.
* To indicate that a resolver has successfully resolved a particular
* (base, property) pair, it must set the <code>propertyResolved</code>
- * property of the <code>ELContext</code> to <code>true</code>. If it could
+ * property of the <code>ELContext</code> to <code>true</code>. If it could
* not handle the given pair, it must leave this property alone. The caller
* must ignore the return value of the method if <code>propertyResolved</code>
* is <code>false</code>.</p>
@@ -86,11 +86,11 @@
* <code>ELResolver</code>
* must set the <code>propertyResolved</code> to <code>true</code> to indicate
* that it handles the conversion of the object to the target type.</p>
- *
+ *
* <p>The {@link #getFeatureDescriptors} and {@link #getCommonPropertyType}
* methods are primarily designed for design-time tool support, but must
- * handle invocation at runtime as well. The
- * {@link java.beans.Beans#isDesignTime} method can be used to determine
+ * handle invocation at runtime as well. The
+ * {@link java.beans.Beans#isDesignTime} method can be used to determine
* if the resolver is being consulted at design-time or runtime.</p>
*
* @see CompositeELResolver
@@ -98,7 +98,7 @@
* @since JSP 2.1
*/
public abstract class ELResolver {
-
+
// --------------------------------------------------------- Constants
/**
@@ -121,18 +121,18 @@
* Attempts to resolve the given <code>property</code> object on the given
* <code>base</code> object.
*
- * <p>If this resolver handles the given (base, property) pair,
- * the <code>propertyResolved</code> property of the
+ * <p>If this resolver handles the given (base, property) pair,
+ * the <code>propertyResolved</code> property of the
* <code>ELContext</code> object must be set to <code>true</code>
- * by the resolver, before returning. If this property is not
- * <code>true</code> after this method is called, the caller should ignore
+ * by the resolver, before returning. If this property is not
+ * <code>true</code> after this method is called, the caller should ignore
* the return value.</p>
*
* @param context The context of this evaluation.
* @param base The base object whose property value is to be returned,
* or <code>null</code> to resolve a top-level variable.
* @param property The property or variable to be resolved.
- * @return If the <code>propertyResolved</code> property of
+ * @return If the <code>propertyResolved</code> property of
* <code>ELContext</code> was set to <code>true</code>, then
* the result of the variable or property resolution; otherwise
* undefined.
@@ -171,7 +171,7 @@
* method's formal parameter types, in declared order.
* Use an empty array if the method has no parameters.
* Can be <code>null</code>, in which case the method's formal
- * parameter types are assumed to be unknown.
+ * parameter types are assumed to be unknown.
* @param params The parameters to pass to the method, or
* <code>null</code> if no parameters.
* @return The result of the method invocation (<code>null</code> if
@@ -197,29 +197,29 @@
/**
* For a given <code>base</code> and <code>property</code>, attempts to
- * identify the most general type that is acceptable for an object to be
- * passed as the <code>value</code> parameter in a future call
+ * identify the most general type that is acceptable for an object to be
+ * passed as the <code>value</code> parameter in a future call
* to the {@link #setValue} method.
*
- * <p>If this resolver handles the given (base, property) pair,
- * the <code>propertyResolved</code> property of the
+ * <p>If this resolver handles the given (base, property) pair,
+ * the <code>propertyResolved</code> property of the
* <code>ELContext</code> object must be set to <code>true</code>
- * by the resolver, before returning. If this property is not
- * <code>true</code> after this method is called, the caller should ignore
+ * by the resolver, before returning. If this property is not
+ * <code>true</code> after this method is called, the caller should ignore
* the return value.</p>
*
* <p>This is not always the same as <code>getValue().getClass()</code>.
* For example, in the case of an {@link ArrayELResolver}, the
- * <code>getType</code> method will return the element type of the
- * array, which might be a superclass of the type of the actual
+ * <code>getType</code> method will return the element type of the
+ * array, which might be a superclass of the type of the actual
* element that is currently in the specified array element.</p>
*
* @param context The context of this evaluation.
* @param base The base object whose property value is to be analyzed,
* or <code>null</code> to analyze a top-level variable.
- * @param property The property or variable to return the acceptable
+ * @param property The property or variable to return the acceptable
* type for.
- * @return If the <code>propertyResolved</code> property of
+ * @return If the <code>propertyResolved</code> property of
* <code>ELContext</code> was set to <code>true</code>, then
* the most general acceptable type; otherwise undefined.
* @throws PropertyNotFoundException if the given (base, property) pair
@@ -235,13 +235,13 @@
Object property);
/**
- * Attempts to set the value of the given <code>property</code>
+ * Attempts to set the value of the given <code>property</code>
* object on the given <code>base</code> object.
*
- * <p>If this resolver handles the given (base, property) pair,
- * the <code>propertyResolved</code> property of the
+ * <p>If this resolver handles the given (base, property) pair,
+ * the <code>propertyResolved</code> property of the
* <code>ELContext</code> object must be set to <code>true</code>
- * by the resolver, before returning. If this property is not
+ * by the resolver, before returning. If this property is not
* <code>true</code> after this method is called, the caller can
* safely assume no value has been set.</p>
*
@@ -272,11 +272,11 @@
* For a given <code>base</code> and <code>property</code>, attempts to
* determine whether a call to {@link #setValue} will always fail.
*
- * <p>If this resolver handles the given (base, property) pair,
- * the <code>propertyResolved</code> property of the
+ * <p>If this resolver handles the given (base, property) pair,
+ * the <code>propertyResolved</code> property of the
* <code>ELContext</code> object must be set to <code>true</code>
- * by the resolver, before returning. If this property is not
- * <code>true</code> after this method is called, the caller should ignore
+ * by the resolver, before returning. If this property is not
+ * <code>true</code> after this method is called, the caller should ignore
* the return value.</p>
*
* @param context The context of this evaluation.
@@ -284,7 +284,7 @@
* or <code>null</code> to analyze a top-level variable.
* @param property The property or variable to return the read-only status
* for.
- * @return If the <code>propertyResolved</code> property of
+ * @return If the <code>propertyResolved</code> property of
* <code>ELContext</code> was set to <code>true</code>, then
* <code>true</code> if the property is read-only or
* <code>false</code> if not; otherwise undefined.
@@ -302,22 +302,22 @@
Object property);
/**
- * Returns information about the set of variables or properties that
+ * Returns information about the set of variables or properties that
* can be resolved for the given <code>base</code> object. One use for
* this method is to assist tools in auto-completion.
*
- * <p>If the <code>base</code> parameter is <code>null</code>, the
- * resolver must enumerate the list of top-level variables it can
+ * <p>If the <code>base</code> parameter is <code>null</code>, the
+ * resolver must enumerate the list of top-level variables it can
* resolve.</p>
*
- * <p>The <code>Iterator</code> returned must contain zero or more
- * instances of {@link java.beans.FeatureDescriptor}, in no guaranteed
- * order. In the case of primitive types such as <code>int</code>, the
- * value <code>null</code> must be returned. This is to prevent the
- * useless iteration through all possible primitive values. A
- * return value of <code>null</code> indicates that this resolver does
- * not handle the given <code>base</code> object or that the results
- * are too complex to represent with this method and the
+ * <p>The <code>Iterator</code> returned must contain zero or more
+ * instances of {@link java.beans.FeatureDescriptor}, in no guaranteed
+ * order. In the case of primitive types such as <code>int</code>, the
+ * value <code>null</code> must be returned. This is to prevent the
+ * useless iteration through all possible primitive values. A
+ * return value of <code>null</code> indicates that this resolver does
+ * not handle the given <code>base</code> object or that the results
+ * are too complex to represent with this method and the
* {@link #getCommonPropertyType} method should be used instead.</p>
*
* <p>Each <code>FeatureDescriptor</code> will contain information about
@@ -325,43 +325,43 @@
* properties, the <code>FeatureDescriptor</code> must have two
* named attributes (as set by the <code>setValue</code> method):
* <ul>
- * <li>{@link #TYPE} - The value of this named attribute must be
- * an instance of <code>java.lang.Class</code> and specify the
+ * <li>{@link #TYPE} - The value of this named attribute must be
+ * an instance of <code>java.lang.Class</code> and specify the
* runtime type of the variable or property.</li>
- * <li>{@link #RESOLVABLE_AT_DESIGN_TIME} - The value of this
- * named attribute must be an instance of
- * <code>java.lang.Boolean</code> and indicates whether it is safe
- * to attempt to resolve this property at design-time. For
- * instance, it may be unsafe to attempt a resolution at design
- * time if the <code>ELResolver</code> needs access to a resource
- * that is only available at runtime and no acceptable simulated
+ * <li>{@link #RESOLVABLE_AT_DESIGN_TIME} - The value of this
+ * named attribute must be an instance of
+ * <code>java.lang.Boolean</code> and indicates whether it is safe
+ * to attempt to resolve this property at design-time. For
+ * instance, it may be unsafe to attempt a resolution at design
+ * time if the <code>ELResolver</code> needs access to a resource
+ * that is only available at runtime and no acceptable simulated
* value can be provided.</li>
- * </ul></p>
+ * </ul>
*
- * <p>The caller should be aware that the <code>Iterator</code>
- * returned might iterate through a very large or even infinitely large
- * set of properties. Care should be taken by the caller to not get
- * stuck in an infinite loop.</p>
+ * <p>The caller should be aware that the <code>Iterator</code>
+ * returned might iterate through a very large or even infinitely large
+ * set of properties. Care should be taken by the caller to not get
+ * stuck in an infinite loop.
*
* <p>This is a "best-effort" list. Not all <code>ELResolver</code>s
* will return completely accurate results, but all must be callable
* at both design-time and runtime (i.e. whether or not
* <code>Beans.isDesignTime()</code> returns <code>true</code>),
- * without causing errors.</p>
+ * without causing errors.
*
- * <p>The <code>propertyResolved</code> property of the
+ * <p>The <code>propertyResolved</code> property of the
* <code>ELContext</code> is not relevant to this method.
* The results of all <code>ELResolver</code>s are concatenated
- * in the case of composite resolvers.</p>
- *
+ * in the case of composite resolvers.
+ *
* @param context The context of this evaluation.
* @param base The base object whose set of valid properties is to
* be enumerated, or <code>null</code> to enumerate the set of
* top-level variables that this resolver can evaluate.
* @return An <code>Iterator</code> containing zero or more (possibly
- * infinitely more) <code>FeatureDescriptor</code> objects, or
- * <code>null</code> if this resolver does not handle the given
- * <code>base</code> object or that the results are too complex to
+ * infinitely more) <code>FeatureDescriptor</code> objects, or
+ * <code>null</code> if this resolver does not handle the given
+ * <code>base</code> object or that the results are too complex to
* represent with this method
* @see java.beans.FeatureDescriptor
*/
@@ -374,11 +374,11 @@
* <code>property</code> argument, given a <code>base</code> object.
* One use for this method is to assist tools in auto-completion.
*
- * <p>This assists tools in auto-completion and also provides a
- * way to express that the resolver accepts a primitive value,
- * such as an integer index into an array. For example, the
- * {@link ArrayELResolver} will accept any <code>int</code> as a
- * <code>property</code>, so the return value would be
+ * <p>This assists tools in auto-completion and also provides a
+ * way to express that the resolver accepts a primitive value,
+ * such as an integer index into an array. For example, the
+ * {@link ArrayELResolver} will accept any <code>int</code> as a
+ * <code>property</code>, so the return value would be
* <code>Integer.class</code>.</p>
*
* @param context The context of this evaluation.
@@ -402,7 +402,8 @@
*
* @param context The context of this evaluation.
* @param obj The object to convert.
- * @param targetType The target type for the convertion.
+ * @param targetType The target type for the conversion.
+ * @return object converted to <code>targetType</code>
* @throws ELException thrown if errors occur.
*/
public Object convertToType(ELContext context,
diff --git a/api/src/main/java/javax/el/ExpressionFactory.java b/api/src/main/java/javax/el/ExpressionFactory.java
index 8f0e191..744eb93 100644
--- a/api/src/main/java/javax/el/ExpressionFactory.java
+++ b/api/src/main/java/javax/el/ExpressionFactory.java
@@ -17,17 +17,18 @@
package javax.el;
-import java.util.Map;
import java.lang.reflect.Method;
-
+import java.util.Map;
import java.util.Properties;
/**
* Provides an implementation for creating and evaluating EL expressions.
*
- * <p>Classes that implement the EL expression language expose their
+ * <p>
+ * Classes that implement the EL expression language expose their
* functionality via this abstract class. An implementation supports the
* following functionalities.
+ *
* <ul>
* <li>
* Parses a <code>String</code> into a {@link ValueExpression} or
@@ -36,21 +37,21 @@
* <li>Implements an <code>ELResolver</code> for query operators</li>
* <li>Provides a default type coercion</li>
* </ul>
- * </p>
+ *
* <p>The {@link #newInstance} method can be used to obtain an
* instance of the implementation.
* Technologies such as
* JavaServer Pages and JavaServer Faces provide access to an
- * implementation via factory methods.</p>
+ * implementation via factory methods.
*
* <p>The {@link #createValueExpression} method is used to parse expressions
* that evaluate to values (both l-values and r-values are supported).
* The {@link #createMethodExpression} method is used to parse expressions
- * that evaluate to a reference to a method on an object.</p>
+ * that evaluate to a reference to a method on an object.
*
* <p>Resolution of model objects is performed at evaluation time, via the
* {@link ELResolver} associated with the {@link ELContext} passed to
- * the <code>ValueExpression</code> or <code>MethodExpression</code>.</p>
+ * the <code>ValueExpression</code> or <code>MethodExpression</code>.
*
* <p>The ELContext object also provides access to the {@link FunctionMapper}
* and {@link VariableMapper} to be used when parsing the expression.
@@ -60,7 +61,7 @@
* {@link FunctionMapper},
* and {@link VariableMapper}
* are not stored for future use and do not have to be
- * <code>Serializable</code>.</p>
+ * <code>Serializable</code>.
*
* <p>The <code>createValueExpression</code> and
* <code>createMethodExpression</code> methods must be thread-safe. That is,
@@ -69,7 +70,7 @@
* should synchronize access if they depend on transient state.
* Implementations should not, however, assume that only one object of
* each <code>ExpressionFactory</code> type will be instantiated; global
- * caching should therefore be static.</p>
+ * caching should therefore be static.
*
* <p>The <code>ExpressionFactory</code> must be able to handle the following
* types of input for the <code>expression</code> parameter:
@@ -85,7 +86,7 @@
* <code>"#{employee.firstName}#{employee.lastName}"</code>).</li>
* <li>Mixed literal text and expressions using the same delimiter (e.g.
* <code>"Name: ${employee.firstName} ${employee.lastName}"</code>).</li>
- * </ul></p>
+ * </ul>
*
* <p>The following types of input are illegal and must cause an
* {@link ELException} to be thrown:
@@ -94,17 +95,17 @@
* <code>"${employee.firstName}#{employee.lastName}"</code>).</li>
* <li>Mixed literal text and expressions using different delimiters(e.g.
* <code>"Name: ${employee.firstName} #{employee.lastName}"</code>).</li>
- * </ul></p>
+ * </ul>
*
* @since JSP 2.1
*/
-
public abstract class ExpressionFactory {
-
+
/**
* Creates a new instance of a <code>ExpressionFactory</code>.
* This method uses the following ordered lookup procedure to determine
* the <code>ExpressionFactory</code> implementation class to load:
+ *
* <ul>
* <li>Use the Services API (as detailed in the JAR specification).
* If a resource with the name of
@@ -122,35 +123,43 @@
* used as the name of the implementation class.</li>
* <li>Use a platform default implementation.</li>
* </ul>
+ *
+ * @return a new <code>ExpressionFactory</code> instance
*/
public static ExpressionFactory newInstance() {
return ExpressionFactory.newInstance(null);
}
/**
- * <p>Create a new instance of a <code>ExpressionFactory</code>, with
+ * Create a new instance of a <code>ExpressionFactory</code>, with
* optional properties.
+ *
+ * <p>
* This method uses the same lookup procedure as the one used in
* <code>newInstance()</code>.
- * </p>
+ *
* <p>
* If the argument <code>properties</code> is not null, and if the
* implementation contains a constructor with a single parameter of
* type <code>java.util.Properties</code>, then the constructor is used
* to create the instance.
- * </p>
+ *
* <p>
* Properties are optional and can be ignored by an implementation.
- * </p>
- * <p>The name of a property should start with "javax.el."</p>
+ *
+ * <p>
+ * The name of a property should start with "javax.el."
+ *
* <p>
* The following are some suggested names for properties.
* <ul>
* <li>javax.el.cacheSize</li>
- * </ul></p>
+ * </ul>
*
* @param properties Properties passed to the implementation.
* If null, then no properties.
+ *
+ * @return a new <code>ExpressionFactory</code> instance
*/
public static ExpressionFactory newInstance(Properties properties) {
return (ExpressionFactory) FactoryFinder.find(
@@ -175,18 +184,17 @@
* functions or variables are not supported for this expression.
* The object
* returned must invoke the same functions and access the same
- * variable mappings
+ * variable mappings
* regardless of whether
* the mappings in the provided <code>FunctionMapper</code>
* and <code>VariableMapper</code> instances
* change between calling
* <code>ExpressionFactory.createValueExpression()</code> and any
* method on <code>ValueExpression</code>.
- * <p>
- * Note that within the EL, the ${} and #{} syntaxes are treated identically.
- * This includes the use of VariableMapper and FunctionMapper at expression creation
- * time. Each is invoked if not null, independent
- * of whether the #{} or ${} syntax is used for the expression.</p>
+ * Note that within the EL, the ${} and #{} syntaxes are treated identically.
+ * This includes the use of VariableMapper and FunctionMapper at expression creation
+ * time. Each is invoked if not null, independent
+ * of whether the #{} or ${} syntax is used for the expression.
* @param expression The expression to parse
* @param expectedType The type the result of the expression
* will be coerced to after evaluation.
@@ -199,18 +207,23 @@
ELContext context,
String expression,
Class<?> expectedType);
-
+
/**
- * Creates a ValueExpression that wraps an object instance. This
+ * Creates a ValueExpression that wraps an object instance.
+ *
+ * <p>
+ * This
* method can be used to pass any object as a ValueExpression. The
* wrapper ValueExpression is read only, and returns the wrapped
* object via its <code>getValue()</code> method, optionally coerced.
+ * </p>
*
* @param instance The object instance to be wrapped.
* @param expectedType The type the result of the expression
* will be coerced to after evaluation. There will be no
* coercion if it is Object.class,
* @throws NullPointerException Thrown if expectedType is null.
+ * @return a ValueExpression that wraps an object instance
*/
public abstract ValueExpression createValueExpression(
Object instance,
@@ -227,10 +240,10 @@
* expectedReturnType is void or if the coercion of the String literal
* to the expectedReturnType yields an error (see Section "1.16 Type
* Conversion").
- * </p>
+ *
* <p>This method should perform syntactic validation of the expression.
* If in doing so it detects errors, it should raise an
- * <code>ELException</code>.</p>
+ * <code>ELException</code>.
*
* @param context The EL context used to parse the expression.
* The <code>FunctionMapper</code> and <code>VariableMapper</code>
@@ -247,12 +260,10 @@
* change between calling
* <code>ExpressionFactory.createMethodExpression()</code> and any
* method on <code>MethodExpression</code>.
- * <p>
- * Note that within the EL, the ${} and #{} syntaxes are treated identically.
- * This includes the use of VariableMapper and FunctionMapper at expression creation
- * time. Each is invoked if not null, independent
- * of whether the #{} or ${} syntax is used for the expression.</p>
- *
+ * Note that within the EL, the ${} and #{} syntaxes are treated identically.
+ * This includes the use of VariableMapper and FunctionMapper at expression creation
+ * time. Each is invoked if not null, independent
+ * of whether the #{} or ${} syntax is used for the expression.
* @param expression The expression to parse
* @param expectedReturnType The expected return type for the method
* to be found. After evaluating the expression, the
@@ -263,7 +274,7 @@
* @param expectedParamTypes The expected parameter types for the method to
* be found. Must be an array with no elements if there are
* no parameters expected. It is illegal to pass <code>null</code>,
- * unless the method is specified with arugments in the EL
+ * unless the method is specified with arguments in the EL
* expression, in which case these arguments are used for method
* selection, and this parameter is ignored.
* @return The parsed expression
@@ -276,7 +287,7 @@
String expression,
Class<?> expectedReturnType,
Class<?>[] expectedParamTypes);
-
+
/**
* Coerces an object to a specific type according to the
* EL type conversion rules. The custom type conversions in the
@@ -284,26 +295,27 @@
*
* <p>An <code>ELException</code> is thrown if an error results from
* applying the conversion rules.
- * </p>
*
* @param obj The object to coerce.
* @param targetType The target type for the coercion.
+ * @return an object coerced to <code>targetType</code>
* @throws ELException thrown if an error results from applying the
* conversion rules.
*/
public abstract Object coerceToType(
Object obj,
Class<?> targetType);
-
+
/**
* Retrieves an ELResolver that implements the operations in collections.
*
- * <p>This ELResolver resolves the method invocation on the pair
+ * <p>
+ * This ELResolver resolves the method invocation on the pair
* (<code>base</code>, <code>property</code>) when <code>base</code> is
* a <code>Collection</code> or a <code>Map</code>, and
* <code>property</code> is the name of the operation.
* <p>See EL.2 for detailed descriptions of these operators, their
- * arguments, and return values.</p>
+ * arguments, and return values.
*
* @return The <code>ELResolver</code> that implements the Query Operators.
*
diff --git a/api/src/main/java/javax/el/LambdaExpression.java b/api/src/main/java/javax/el/LambdaExpression.java
index 5810002..0cfd911 100644
--- a/api/src/main/java/javax/el/LambdaExpression.java
+++ b/api/src/main/java/javax/el/LambdaExpression.java
@@ -16,22 +16,26 @@
package javax.el;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.HashMap;
-import java.util.ArrayList;
/**
- * <p>Encapsulates a parameterized {@link ValueExpression}.</p>
+ * Encapsulates a parameterized {@link ValueExpression}.
*
* <p>A <code>LambdaExpression</code> is a representation of the EL Lambda
* expression syntax. It consists of a list of the formal parameters and a
* body, represented by a {@link ValueExpression}.
* The body can be any valid <code>Expression</code>, including another
- * <code>LambdaExpression</code>.</p>
+ * <code>LambdaExpression</code>.
+ *
+ * <p>
* A <code>LambdaExpression</code> is created when an EL expression containing
- * a Lambda expression is evaluated.</p>
- * <p>A <code>LambdaExpression</code> can be invoked by calling
+ * a Lambda expression is evaluated.
+ *
+ * <p>
+ * A <code>LambdaExpression</code> can be invoked by calling
* {@link LambdaExpression#invoke}, with
* an {@link javax.el.ELContext} and a list of the actual arguments.
* Alternately, a <code>LambdaExpression</code> can be invoked without passing
@@ -40,7 +44,8 @@
* The evaluation of the <code>ValueExpression</code> in the body uses the
* {@link ELContext} to resolve references to the parameters, and to evaluate
* the lambda expression.
- * The result of the evaluation is returned.</p>
+ * The result of the evaluation is returned.
+ *
* @see ELContext#getLambdaArgument
* @see ELContext#enterLambdaScope
* @see ELContext#exitLambdaScope
@@ -99,7 +104,7 @@
* @throws ELException if not enough arguments are provided
* @throws NullPointerException is elContext is null
*/
- public Object invoke(ELContext elContext, Object... args)
+ public Object invoke(ELContext elContext, Object... args)
throws ELException {
int i = 0;
Map<String, Object> lambdaArgs = new HashMap<String, Object>();
diff --git a/api/src/main/java/javax/el/MapELResolver.java b/api/src/main/java/javax/el/MapELResolver.java
index bb2d9da..6af6f4b 100644
--- a/api/src/main/java/javax/el/MapELResolver.java
+++ b/api/src/main/java/javax/el/MapELResolver.java
@@ -18,28 +18,28 @@
package javax.el;
import java.beans.FeatureDescriptor;
-import java.util.Map;
-import java.util.Iterator;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
-import java.util.ArrayList;
+import java.util.Map;
/**
* Defines property resolution behavior on instances of {@link java.util.Map}.
*
* <p>This resolver handles base objects of type <code>java.util.Map</code>.
* It accepts any object as a property and uses that object as a key in
- * the map. The resulting value is the value in the map that is associated with
+ * the map. The resulting value is the value in the map that is associated with
* that key.</p>
*
* <p>This resolver can be constructed in read-only mode, which means that
- * {@link #isReadOnly} will always return <code>true</code> and
+ * {@link #isReadOnly} will always return <code>true</code> and
* {@link #setValue} will always throw
* <code>PropertyNotWritableException</code>.</p>
*
- * <p><code>ELResolver</code>s are combined together using
- * {@link CompositeELResolver}s, to define rich semantics for evaluating
+ * <p><code>ELResolver</code>s are combined together using
+ * {@link CompositeELResolver}s, to define rich semantics for evaluating
* an expression. See the javadocs for {@link ELResolver} for details.</p>
*
* @see CompositeELResolver
@@ -68,13 +68,13 @@
}
/**
- * If the base object is a map, returns the most general acceptable type
+ * If the base object is a map, returns the most general acceptable type
* for a value in this map.
*
* <p>If the base is a <code>Map</code>, the <code>propertyResolved</code>
* property of the <code>ELContext</code> object must be set to
* <code>true</code> by this resolver, before returning. If this property
- * is not <code>true</code> after this method is called, the caller
+ * is not <code>true</code> after this method is called, the caller
* should ignore the return value.</p>
*
* <p>Assuming the base is a <code>Map</code>, this method will always
@@ -86,7 +86,7 @@
* are handled by this resolver.
* @param property The key to return the acceptable type for.
* Ignored by this resolver.
- * @return If the <code>propertyResolved</code> property of
+ * @return If the <code>propertyResolved</code> property of
* <code>ELContext</code> was set to <code>true</code>, then
* the most general acceptable type; otherwise undefined.
* @throws NullPointerException if context is <code>null</code>
@@ -95,6 +95,7 @@
* must be included as the cause property of this exception, if
* available.
*/
+ @Override
public Class<?> getType(ELContext context,
Object base,
Object property) {
@@ -102,7 +103,7 @@
if (context == null) {
throw new NullPointerException();
}
-
+
if (base != null && base instanceof Map) {
context.setPropertyResolved(true);
return Object.class;
@@ -118,7 +119,7 @@
* <p>If the base is a <code>Map</code>, the <code>propertyResolved</code>
* property of the <code>ELContext</code> object must be set to
* <code>true</code> by this resolver, before returning. If this property
- * is not <code>true</code> after this method is called, the caller
+ * is not <code>true</code> after this method is called, the caller
* should ignore the return value.</p>
*
* <p>Just as in {@link java.util.Map#get}, just because <code>null</code>
@@ -130,13 +131,13 @@
* @param base The map to be analyzed. Only bases of type <code>Map</code>
* are handled by this resolver.
* @param property The key whose associated value is to be returned.
- * @return If the <code>propertyResolved</code> property of
+ * @return If the <code>propertyResolved</code> property of
* <code>ELContext</code> was set to <code>true</code>, then
* the value associated with the given key or <code>null</code>
* if the key was not found. Otherwise, undefined.
- * @throws ClassCastException if the key is of an inappropriate type
+ * @throws ClassCastException if the key is of an inappropriate type
* for this map (optionally thrown by the underlying <code>Map</code>).
- * @throws NullPointerException if context is <code>null</code>, or if
+ * @throws NullPointerException if context is <code>null</code>, or if
* the key is null and this map does not permit null keys (the
* latter is optionally thrown by the underlying <code>Map</code>).
* @throws ELException if an exception was thrown while performing
@@ -144,6 +145,7 @@
* must be included as the cause property of this exception, if
* available.
*/
+ @Override
public Object getValue(ELContext context,
Object base,
Object property) {
@@ -170,18 +172,18 @@
* <p>If the base is a <code>Map</code>, the <code>propertyResolved</code>
* property of the <code>ELContext</code> object must be set to
* <code>true</code> by this resolver, before returning. If this property
- * is not <code>true</code> after this method is called, the caller
+ * is not <code>true</code> after this method is called, the caller
* can safely assume no value was set.</p>
*
* <p>If this resolver was constructed in read-only mode, this method will
* always throw <code>PropertyNotWritableException</code>.</p>
*
- * <p>If a <code>Map</code> was created using
+ * <p>If a <code>Map</code> was created using
* {@link java.util.Collections#unmodifiableMap}, this method must
- * throw <code>PropertyNotWritableException</code>. Unfortunately,
- * there is no Collections API method to detect this. However, an
- * implementation can create a prototype unmodifiable <code>Map</code>
- * and query its runtime type to see if it matches the runtime type of
+ * throw <code>PropertyNotWritableException</code>. Unfortunately,
+ * there is no Collections API method to detect this. However, an
+ * implementation can create a prototype unmodifiable <code>Map</code>
+ * and query its runtime type to see if it matches the runtime type of
* the base object as a workaround.</p>
*
* @param context The context of this evaluation.
@@ -190,21 +192,22 @@
* @param property The key with which the specified value is to be
* associated.
* @param val The value to be associated with the specified key.
- * @throws ClassCastException if the class of the specified key or
+ * @throws ClassCastException if the class of the specified key or
* value prevents it from being stored in this map.
- * @throws NullPointerException if context is <code>null</code>, or if
+ * @throws NullPointerException if context is <code>null</code>, or if
* this map does not permit <code>null</code> keys or values, and
* the specified key or value is <code>null</code>.
- * @throws IllegalArgumentException if some aspect of this key or
+ * @throws IllegalArgumentException if some aspect of this key or
* value prevents it from being stored in this map.
* @throws ELException if an exception was thrown while performing
* the property or variable resolution. The thrown exception
* must be included as the cause property of this exception, if
* available.
* @throws PropertyNotWritableException if this resolver was constructed
- * in read-only mode, or if the put operation is not supported by
+ * in read-only mode, or if the put operation is not supported by
* the underlying map.
*/
+ @Override
public void setValue(ELContext context,
Object base,
Object property,
@@ -231,24 +234,24 @@
}
/**
- * If the base object is a map, returns whether a call to
+ * If the base object is a map, returns whether a call to
* {@link #setValue} will always fail.
*
* <p>If the base is a <code>Map</code>, the <code>propertyResolved</code>
* property of the <code>ELContext</code> object must be set to
* <code>true</code> by this resolver, before returning. If this property
- * is not <code>true</code> after this method is called, the caller
+ * is not <code>true</code> after this method is called, the caller
* should ignore the return value.</p>
*
* <p>If this resolver was constructed in read-only mode, this method will
* always return <code>true</code>.</p>
*
- * <p>If a <code>Map</code> was created using
+ * <p>If a <code>Map</code> was created using
* {@link java.util.Collections#unmodifiableMap}, this method must
* return <code>true</code>. Unfortunately, there is no Collections API
* method to detect this. However, an implementation can create a
* prototype unmodifiable <code>Map</code> and query its runtime type
- * to see if it matches the runtime type of the base object as a
+ * to see if it matches the runtime type of the base object as a
* workaround.</p>
*
* @param context The context of this evaluation.
@@ -256,7 +259,7 @@
* are handled by this resolver.
* @param property The key to return the read-only status for.
* Ignored by this resolver.
- * @return If the <code>propertyResolved</code> property of
+ * @return If the <code>propertyResolved</code> property of
* <code>ELContext</code> was set to <code>true</code>, then
* <code>true</code> if calling the <code>setValue</code> method
* will always fail or <code>false</code> if it is possible that
@@ -267,6 +270,7 @@
* must be included as the cause property of this exception, if
* available.
*/
+ @Override
public boolean isReadOnly(ELContext context,
Object base,
Object property) {
@@ -285,41 +289,44 @@
/**
* If the base object is a map, returns an <code>Iterator</code>
- * containing the set of keys available in the <code>Map</code>.
+ * containing the set of keys available in the <code>Map</code>.
* Otherwise, returns <code>null</code>.
*
- * <p>The <code>Iterator</code> returned must contain zero or more
- * instances of {@link java.beans.FeatureDescriptor}. Each info object
- * contains information about a key in the Map, and is initialized as
+ * <p>
+ * The <code>Iterator</code> returned must contain zero or more
+ * instances of {@link java.beans.FeatureDescriptor}. Each info object
+ * contains information about a key in the Map, and is initialized as
* follows:
- * <dl>
- * <li>displayName - The return value of calling the
- * <code>toString</code> method on this key, or
+ * <ul>
+ * <li>displayName - The return value of calling the
+ * <code>toString</code> method on this key, or
* <code>"null"</code> if the key is <code>null</code>.</li>
* <li>name - Same as displayName property.</li>
* <li>shortDescription - Empty string</li>
* <li>expert - <code>false</code></li>
* <li>hidden - <code>false</code></li>
* <li>preferred - <code>true</code></li>
- * </dl>
+ * </ul>
+ *
* In addition, the following named attributes must be set in the
* returned <code>FeatureDescriptor</code>s:
- * <dl>
+ * <ul>
* <li>{@link ELResolver#TYPE} - The return value of calling the <code>getClass()</code>
* method on this key, or <code>null</code> if the key is
* <code>null</code>.</li>
* <li>{@link ELResolver#RESOLVABLE_AT_DESIGN_TIME} - <code>true</code></li>
- * </dl>
- * </p>
- *
+ * </ul>
+ *
+ *
* @param context The context of this evaluation.
- * @param base The map whose keys are to be iterated over. Only bases
+ * @param base The map whose keys are to be iterated over. Only bases
* of type <code>Map</code> are handled by this resolver.
* @return An <code>Iterator</code> containing zero or more (possibly
* infinitely more) <code>FeatureDescriptor</code> objects, each
- * representing a key in this map, or <code>null</code> if
+ * representing a key in this map, or <code>null</code> if
* the base object is not a map.
*/
+ @Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(
ELContext context,
Object base) {
@@ -350,7 +357,7 @@
}
/**
- * If the base object is a map, returns the most general type that
+ * If the base object is a map, returns the most general type that
* this resolver accepts for the <code>property</code> argument.
* Otherwise, returns <code>null</code>.
*
@@ -364,6 +371,7 @@
* @return <code>null</code> if base is not a <code>Map</code>; otherwise
* <code>Object.class</code>.
*/
+ @Override
public Class<?> getCommonPropertyType(ELContext context,
Object base) {
if (base != null && base instanceof Map) {
diff --git a/api/src/main/java/javax/el/MethodExpression.java b/api/src/main/java/javax/el/MethodExpression.java
index d6928ab..f0ae67b 100644
--- a/api/src/main/java/javax/el/MethodExpression.java
+++ b/api/src/main/java/javax/el/MethodExpression.java
@@ -23,28 +23,28 @@
* <p>The {@link javax.el.ExpressionFactory#createMethodExpression} method
* can be used to parse an expression string and return a concrete instance
* of <code>MethodExpression</code> that encapsulates the parsed expression.
- * The {@link FunctionMapper} is used at parse time, not evaluation time,
- * so one is not needed to evaluate an expression using this class.
+ * The {@link FunctionMapper} is used at parse time, not evaluation time,
+ * so one is not needed to evaluate an expression using this class.
* However, the {@link ELContext} is needed at evaluation time.</p>
*
- * <p>The {@link #getMethodInfo} and {@link #invoke} methods will evaluate the
- * expression each time they are called. The {@link ELResolver} in the
- * <code>ELContext</code> is used to resolve the top-level variables and to
- * determine the behavior of the <code>.</code> and <code>[]</code>
+ * <p>The {@link #getMethodInfo} and {@link #invoke} methods will evaluate the
+ * expression each time they are called. The {@link ELResolver} in the
+ * <code>ELContext</code> is used to resolve the top-level variables and to
+ * determine the behavior of the <code>.</code> and <code>[]</code>
* operators. For any of the two methods, the
- * {@link javax.el.ELResolver#getValue}
- * method is used to resolve all properties up to but excluding the last
+ * {@link javax.el.ELResolver#getValue}
+ * method is used to resolve all properties up to but excluding the last
* one. This provides the <code>base</code> object on which the method
- * appears. If the <code>base</code> object is null, a
+ * appears. If the <code>base</code> object is null, a
* <code>PropertyNotFoundException</code> must be thrown.
- * At the last resolution,
+ * At the last resolution,
* the final <code>property</code> is then coerced to a <code>String</code>,
- * which provides the name of the method to be found. A method matching the
- * name and expected parameters provided at parse time is found and it is
+ * which provides the name of the method to be found. A method matching the
+ * name and expected parameters provided at parse time is found and it is
* either queried or invoked (depending on the method called on this
* <code>MethodExpression</code>).</p>
*
- * <p>See the notes about comparison, serialization and immutability in
+ * <p>See the notes about comparison, serialization and immutability in
* the {@link Expression} javadocs.
*
* @see ELResolver
@@ -55,7 +55,7 @@
public abstract class MethodExpression extends Expression
{
// Evaluation
-
+
/**
* Evaluates the expression relative to the provided context, and
* returns information about the actual referenced method.
@@ -65,7 +65,7 @@
* about the method the expression evaluated to.
* @throws NullPointerException if context is <code>null</code>
* @throws PropertyNotFoundException if one of the property
- * resolutions failed because a specified variable or property
+ * resolutions failed because a specified variable or property
* does not exist or is not readable.
* @throws MethodNotFoundException if no suitable method can be found.
* @throws ELException if an exception was thrown while performing
@@ -74,18 +74,18 @@
* available.
*/
public abstract MethodInfo getMethodInfo(ELContext context);
-
+
/**
- * If a String literal is specified as the expression, returns the
- * String literal coerced to the expected return type of the method
- * signature. An <code>ELException</code> is thrown if
- * <code>expectedReturnType</code> is void or if the coercion of the String literal
+ * If a String literal is specified as the expression, returns the
+ * String literal coerced to the expected return type of the method
+ * signature. An <code>ELException</code> is thrown if
+ * <code>expectedReturnType</code> is void or if the coercion of the String literal
* to the <code>expectedReturnType</code> yields an error (see Section "1.18 Type
* Conversion" of the EL specification).
- *
- * If not a String literal, evaluates the expression
- * relative to the provided context, invokes the method that was
- * found using the supplied parameters, and returns the result of
+ *
+ * If not a String literal, evaluates the expression
+ * relative to the provided context, invokes the method that was
+ * found using the supplied parameters, and returns the result of
* the method invocation.
*
* Any parameters passed to this method is ignored if isLiteralText()
@@ -98,14 +98,14 @@
* the method has a <code>void</code> return type).
* @throws NullPointerException if context is <code>null</code>
* @throws PropertyNotFoundException if one of the property
- * resolutions failed because a specified variable or property
+ * resolutions failed because a specified variable or property
* does not exist or is not readable.
* @throws MethodNotFoundException if no suitable method can be found.
* @throws ELException if a String literal is specified and
- * expectedReturnType of the MethodExpression is void or if the coercion of the String literal
+ * expectedReturnType of the MethodExpression is void or if the coercion of the String literal
* to the expectedReturnType yields an error (see Section "1.18 Type
* Conversion").
- * @throws ELException if
+ * @throws ELException if
* an exception was thrown while performing
* property or variable resolution. The thrown exception must be
* included as the cause property of this exception, if
@@ -133,6 +133,8 @@
/**
* Use isParametersProvided instead.
+ * @return <code>true</code> if the MethodExpression was created with
+ * parameters, <code>false</code> otherwise.
*/
@Deprecated
public boolean isParmetersProvided() {
diff --git a/api/src/main/java/javax/el/ResourceBundleELResolver.java b/api/src/main/java/javax/el/ResourceBundleELResolver.java
index 233d648..01fa3d7 100644
--- a/api/src/main/java/javax/el/ResourceBundleELResolver.java
+++ b/api/src/main/java/javax/el/ResourceBundleELResolver.java
@@ -28,25 +28,25 @@
/**
* Defines property resolution behavior on instances of
* {@link java.util.ResourceBundle}.
- *
+ *
* <p>
* This resolver handles base objects of type
* <code>java.util.ResourceBundle</code>. It accepts any object as a property
* and coerces it to a <code>java.lang.String</code> for invoking
* {@link java.util.ResourceBundle#getObject(java.lang.String)}.
* </p>
- *
+ *
* <p>
* This resolver is read only and will throw a
* {@link PropertyNotWritableException} if <code>setValue</code> is called.
* </p>
- *
+ *
* <p>
* <code>ELResolver</code>s are combined together using
* {@link CompositeELResolver}s, to define rich semantics for evaluating an
* expression. See the javadocs for {@link ELResolver} for details.
* </p>
- *
+ *
* @see CompositeELResolver
* @see ELResolver
* @see java.util.ResourceBundle
@@ -59,13 +59,14 @@
* the provided property will first be coerced to a <code>String</code>.
* The <code>Object</code> returned by <code>getObject</code> on
* the base <code>ResourceBundle</code> will be returned.
- * </p>
+ *
+ * <p>
* If the base is <code>ResourceBundle</code>, the
* <code>propertyResolved</code> property of the <code>ELContext</code>
* object must be set to <code>true</code> by this resolver, before
* returning. If this property is not <code>true</code> after this method
* is called, the caller should ignore the return value.
- * </p>
+ *
* @param context
* The context of this evaluation.
* @param base
@@ -79,7 +80,7 @@
* otherwise the <code>Object</code> for the given key
* (property coerced to <code>String</code>) from the
* <code>ResourceBundle</code>.
- * If no object for the given key can be found, then the
+ * If no object for the given key can be found, then the
* <code>String</code> "???" + key + "???".
* @throws NullPointerException
* if context is <code>null</code>
@@ -88,6 +89,7 @@
* variable resolution. The thrown exception must be included as
* the cause property of this exception, if available.
*/
+ @Override
public Object getValue(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException();
@@ -110,7 +112,7 @@
/**
* If the base object is an instance of <code>ResourceBundle</code>,
* return <code>null</code>, since the resolver is read only.
- *
+ *
* <p>
* If the base is <code>ResourceBundle</code>, the
* <code>propertyResolved</code> property of the <code>ELContext</code>
@@ -118,7 +120,7 @@
* returning. If this property is not <code>true</code> after this method
* is called, the caller should ignore the return value.
* </p>
- *
+ *
* @param context
* The context of this evaluation.
* @param base
@@ -131,6 +133,7 @@
* @throws NullPointerException
* if context is <code>null</code>
*/
+ @Override
public Class<?> getType(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException();
@@ -145,7 +148,7 @@
/**
* If the base object is a ResourceBundle, throw a
* {@link PropertyNotWritableException}.
- *
+ *
* @param context
* The context of this evaluation.
* @param base
@@ -160,6 +163,7 @@
* @throws PropertyNotWritableException
* Always thrown if base is an instance of ReasourceBundle.
*/
+ @Override
public void setValue(ELContext context, Object base, Object property,
Object value) {
if (context == null) {
@@ -174,9 +178,9 @@
}
/**
- * If the base object is not null and an instanceof {@link ResourceBundle},
+ * If the base object is not null and an <code>instanceof</code> {@link ResourceBundle},
* return <code>true</code>.
- *
+ *
* @param context
* The context of this evaluation.
* @param base
@@ -190,6 +194,7 @@
* @throws NullPointerException
* if context is <code>null</code>
*/
+ @Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException();
@@ -205,28 +210,29 @@
* If the base object is a ResourceBundle, returns an <code>Iterator</code>
* containing the set of keys available in the <code>ResourceBundle</code>.
* Otherwise, returns <code>null</code>.
- *
+ *
* <p>
* The <code>Iterator</code> returned must contain zero or more instances
* of {@link java.beans.FeatureDescriptor}. Each info object contains
* information about a key in the ResourceBundle, and is initialized as
* follows:
- * <dl>
+ * <ul>
* <li>displayName - The <code>String</code> key
* <li>name - Same as displayName property.</li>
* <li>shortDescription - Empty string</li>
* <li>expert - <code>false</code></li>
* <li>hidden - <code>false</code></li>
* <li>preferred - <code>true</code></li>
- * </dl>
+ * </ul>
+ *
* In addition, the following named attributes must be set in the returned
* <code>FeatureDescriptor</code>s:
- * <dl>
+ * <ul>
* <li>{@link ELResolver#TYPE} - <code>String.class</code></li>
* <li>{@link ELResolver#RESOLVABLE_AT_DESIGN_TIME} - <code>true</code></li>
- * </dl>
- * </p>
- *
+ * </ul>
+ *
+ *
* @param context
* The context of this evaluation.
* @param base
@@ -238,6 +244,7 @@
* representing a key in this bundle, or <code>null</code> if the
* base object is not a ResourceBundle.
*/
+ @Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
if (base instanceof ResourceBundle) {
ResourceBundle bundle = (ResourceBundle) base;
@@ -265,11 +272,11 @@
* If the base object is a ResourceBundle, returns the most general type
* that this resolver accepts for the <code>property</code> argument.
* Otherwise, returns <code>null</code>.
- *
+ *
* <p>
* Assuming the base is a <code>ResourceBundle</code>, this method will
* always return <code>String.class</code>.
- *
+ *
* @param context
* The context of this evaluation.
* @param base
@@ -278,6 +285,7 @@
* @return <code>null</code> if base is not a <code>ResourceBundle</code>;
* otherwise <code>String.class</code>.
*/
+ @Override
public Class<?> getCommonPropertyType(ELContext context, Object base) {
if (base instanceof ResourceBundle) {
return String.class;
diff --git a/api/src/main/java/javax/el/StandardELContext.java b/api/src/main/java/javax/el/StandardELContext.java
index fa901fc..b88d99d 100644
--- a/api/src/main/java/javax/el/StandardELContext.java
+++ b/api/src/main/java/javax/el/StandardELContext.java
@@ -16,15 +16,15 @@
package javax.el;
-import java.util.Map;
-import java.util.HashMap;
import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
/**
* A standard ELContext suitable for use in a stand alone environment.
* This class provides a default implementation of an ELResolver that contains
* a number of useful ELResolvers. It also provides local repositories for
- * the FunctionMapper, VariableMapper, and BeanNameResolver.
+ * the FunctionMapper, VariableMapper, and BeanNameResolver.
*
* @since EL 3.0
*/
@@ -68,7 +68,7 @@
* easy way to get its private context map, therefore delegation is needed.
*/
private ELContext delegate = null;
-
+
/**
* A bean repository local to this context
*/
@@ -76,7 +76,7 @@
/**
* Construct a default ELContext for a stand-alone environment.
- * @param factory The ExpressionFactory
+ * @param factory The ExpressionFactory
*/
public StandardELContext(ExpressionFactory factory) {
this.streamELResolver = factory.getStreamELResolver();
@@ -122,9 +122,12 @@
/**
* Construct (if needed) and return a default ELResolver.
- * <p>Retrieves the <code>ELResolver</code> associated with this context.
+ *
+ * <p>
+ * Retrieves the <code>ELResolver</code> associated with this context.
* This is a <code>CompositeELResover</code> consists of an ordered list of
* <code>ELResolver</code>s.
+ *
* <ol>
* <li>A {@link BeanNameELResolver} for beans defined locally</li>
* <li>Any custom <code>ELResolver</code>s</li>
@@ -136,7 +139,7 @@
* <li>An {@link ArrayELResolver} for resolving array properties</li>
* <li>A {@link BeanELResolver} for resolving bean properties</li>
* </ol>
- * </p>
+ *
* @return The ELResolver for this context.
*/
@Override
@@ -177,7 +180,7 @@
*/
Map<String, Object> getBeans() {
return beans;
- }
+ }
/**
* Construct (if needed) and return a default FunctionMapper.
@@ -218,7 +221,7 @@
return functions.get(prefix + ":" + localName);
}
-
+
@Override
public void mapFunction(String prefix, String localName, Method meth){
functions.put(prefix + ":" + localName, meth);
@@ -281,4 +284,4 @@
}
}
}
-
+
diff --git a/api/src/main/java/javax/el/StaticFieldELResolver.java b/api/src/main/java/javax/el/StaticFieldELResolver.java
index 173b6ee..4726d90 100644
--- a/api/src/main/java/javax/el/StaticFieldELResolver.java
+++ b/api/src/main/java/javax/el/StaticFieldELResolver.java
@@ -16,16 +16,15 @@
package javax.el;
-import java.util.Iterator;
+import java.beans.FeatureDescriptor;
+import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.lang.reflect.Constructor;
-
-import java.beans.FeatureDescriptor;
+import java.util.Iterator;
/**
- * <p>An {@link ELResolver} for resolving static fields, enum constants and
+ * <p>An {@link ELResolver} for resolving static fields, enum constants and
* static methods. Also handles constructor calls as a special case.</p>
* <p>The resolver handles base objects of the type {@link ELClass}, which
* is usually generated by an EL implementation.</p>
@@ -98,7 +97,8 @@
* @param property The name of the field
* @param value The value to set the field of the class to.
* @throws NullPointerException if context is <code>null</code>
- * @throws PropertyNotWritableException
+ * @throws PropertyNotWritableException if base object instance of <code>ELClass</code>and
+ * <code>property</code> instance of String
*/
@Override
public void setValue(ELContext context, Object base, Object property,
@@ -117,21 +117,27 @@
}
/**
- * <p>Invokes a public static method or the constructor for a class.</p>
+ * Invokes a public static method or the constructor for a class.
*
+ * <p>
* If the base object is an instance of <code>ELClass</code> and the
* method is a String,
* the <code>propertyResolved</code> property of the
* <code>ELContext</code> object must be set to <code>true</code>
* by the resolver, before returning. If this property is not
* <code>true</code> after this method is called, the caller
- * should ignore the return value.</p>
- * <p>Invoke the public static method specified by <code>method</code>.</p>
- * <p>The process involved in the method selection is
- * the same as that used in {@link BeanELResolver}.</p>
+ * should ignore the return value.
*
- * <p>As a special case, if the name of the method is "<init>", the
- * constructor for the class will be invoked.</p>
+ * <p>
+ * Invoke the public static method specified by <code>method</code>.
+ *
+ * <p>
+ * The process involved in the method selection is
+ * the same as that used in {@link BeanELResolver}.
+ *
+ * <p>
+ * As a special case, if the name of the method is "<init>", the
+ * constructor for the class will be invoked.
*
* @param base An <code>ELClass</code>
* @param method When coerced to a <code>String</code>,
@@ -187,17 +193,21 @@
}
/**
- * <p>Returns the type of a static field.</p>
- * <p>If the base object is an instance of <code>ELClass</code>and the
+ * Returns the type of a static field.
+ *
+ * <p>
+ * If the base object is an instance of <code>ELClass</code>and the
* property is a String,
* the <code>propertyResolved</code> property of the
* <code>ELContext</code> object must be set to <code>true</code>
* by the resolver, before returning. If this property is not
* <code>true</code> after this method is called, the caller can
- * safely assume no value has been set.</p>
+ * safely assume no value has been set.
*
+ * <p>
* If the property string is a public static field of class specified in
- * ELClass, return the type of the static field.</p>
+ * ELClass, return the type of the static field.
+ *
* @param context The context of this evaluation.
* @param base An <code>ELClass</code>.
* @param property The name of the field.
@@ -268,7 +278,7 @@
/**
* Returns the properties that can be resolved.
- * Always returns <code>null</code>, since there is no reason to
+ * Always returns <code>null</code>, since there is no reason to
* iterate through a list of one element: field name.
* @param context The context of this evaluation.
* @param base An <code>ELClass</code>.
diff --git a/api/src/main/java/javax/el/TypeConverter.java b/api/src/main/java/javax/el/TypeConverter.java
index 8a6d86f..02e13a5 100644
--- a/api/src/main/java/javax/el/TypeConverter.java
+++ b/api/src/main/java/javax/el/TypeConverter.java
@@ -16,25 +16,28 @@
package javax.el;
-import java.util.Iterator;
import java.beans.FeatureDescriptor;
+import java.util.Iterator;
/**
* A convenient class for writing an ELResolver to do custom type conversions.
*
* <p>For example, to convert a String to an instance of MyDate, one can write
- * <blockquote><pre>
+ *
+ * <pre>
+ * <code>
* ELProcessor elp = new ELProcessor();
* elp.getELManager().addELResolver(new TypeConverter() {
- * Object convertToType(ELContext context, Object obj, Class<?> type) {
- * if ((obj instanceof String) && type == MyDate.class) {
+ * Object convertToType(ELContext context, Object obj, Class<?> type) {
+ * if ((obj instanceof String) && type == MyDate.class) {
* context.setPropertyResolved(obj, type);
* return (obj == null)? null: new MyDate(obj.toString());
* }
* return null;
* }
* };
- * </pre></blockquote>
+ * </code>
+ * </pre>
*
* @since EL 3.0
*/
diff --git a/impl/src/main/java/com/sun/el/MethodExpressionImpl.java b/impl/src/main/java/com/sun/el/MethodExpressionImpl.java
index 2f98e8b..106e79c 100644
--- a/impl/src/main/java/com/sun/el/MethodExpressionImpl.java
+++ b/impl/src/main/java/com/sun/el/MethodExpressionImpl.java
@@ -32,9 +32,7 @@
import javax.el.MethodNotFoundException;
import javax.el.PropertyNotFoundException;
import javax.el.VariableMapper;
-import javax.el.EvaluationListener;
-import com.sun.el.lang.ELSupport;
import com.sun.el.lang.EvaluationContext;
import com.sun.el.lang.ExpressionBuilder;
import com.sun.el.parser.Node;
@@ -42,38 +40,38 @@
/**
* An <code>Expression</code> that refers to a method on an object.
- *
+ *
* <p>
- * <code>The {@link ExpressionFactory#createMethodExpression} method
+ * The {@link ExpressionFactory#createMethodExpression} method
* can be used to parse an expression string and return a concrete instance
* of <code>MethodExpression</code> that encapsulates the parsed expression.
- * The {@link FunctionMapper} is used at parse time, not evaluation time,
- * so one is not needed to evaluate an expression using this class.
+ * The {@link FunctionMapper} is used at parse time, not evaluation time,
+ * so one is not needed to evaluate an expression using this class.
* However, the {@link ELContext} is needed at evaluation time.</p>
*
- * <p>The {@link #getMethodInfo} and {@link #invoke} methods will evaluate the
- * expression each time they are called. The {@link ELResolver} in the
- * <code>ELContext</code> is used to resolve the top-level variables and to
- * determine the behavior of the <code>.</code> and <code>[]</code>
- * operators. For any of the two methods, the {@link ELResolver#getValue}
- * method is used to resolve all properties up to but excluding the last
+ * <p>The {@link #getMethodInfo} and {@link #invoke} methods will evaluate the
+ * expression each time they are called. The {@link ELResolver} in the
+ * <code>ELContext</code> is used to resolve the top-level variables and to
+ * determine the behavior of the <code>.</code> and <code>[]</code>
+ * operators. For any of the two methods, the {@link ELResolver#getValue}
+ * method is used to resolve all properties up to but excluding the last
* one. This provides the <code>base</code> object on which the method
- * appears. If the <code>base</code> object is null, a
- * <code>NullPointerException</code> must be thrown. At the last resolution,
+ * appears. If the <code>base</code> object is null, a
+ * <code>NullPointerException</code> must be thrown. At the last resolution,
* the final <code>property</code> is then coerced to a <code>String</code>,
- * which provides the name of the method to be found. A method matching the
- * name and expected parameters provided at parse time is found and it is
+ * which provides the name of the method to be found. A method matching the
+ * name and expected parameters provided at parse time is found and it is
* either queried or invoked (depending on the method called on this
* <code>MethodExpression</code>).</p>
*
- * <p>See the notes about comparison, serialization and immutability in
+ * <p>See the notes about comparison, serialization and immutability in
* the {@link Expression} javadocs.
*
* @see javax.el.ELResolver
* @see javax.el.Expression
* @see javax.el.ExpressionFactory
* @see javax.el.MethodExpression
- *
+ *
* @author Jacob Hookom [jacob@hookom.net]
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: kchung $
*/
@@ -93,18 +91,19 @@
private Class[] paramTypes;
/**
- *
+ *
*/
public MethodExpressionImpl() {
super();
}
/**
- * @param expr
- * @param node
- * @param fnMapper
- * @param expectedType
- * @param paramTypes
+ * @param expr the expression
+ * @param node the node
+ * @param fnMapper the function mapper
+ * @param varMapper the variable mapper
+ * @param expectedType expected return type of method
+ * @param paramTypes the method parameters
*/
public MethodExpressionImpl(String expr, Node node,
FunctionMapper fnMapper, VariableMapper varMapper,
@@ -121,7 +120,7 @@
/**
* Determines whether the specified object is equal to this
* <code>Expression</code>.
- *
+ *
* <p>
* The result is <code>true</code> if and only if the argument is not
* <code>null</code>, is an <code>Expression</code> object that is the
@@ -129,7 +128,7 @@
* <code>MethodExpression</code>), and has an identical parsed
* representation.
* </p>
- *
+ *
* <p>
* Note that two expressions can be equal if their expression Strings are
* different. For example, <code>${fn1:foo()}</code> and
@@ -137,7 +136,7 @@
* <code>FunctionMapper</code>s mapped <code>fn1:foo</code> and
* <code>fn2:foo</code> to the same method.
* </p>
- *
+ *
* @param obj
* the <code>Object</code> to test for equality.
* @return <code>true</code> if <code>obj</code> equals this
@@ -145,6 +144,7 @@
* @see java.util.Hashtable
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof MethodExpressionImpl) {
MethodExpressionImpl me = (MethodExpressionImpl) obj;
@@ -156,24 +156,25 @@
/**
* Returns the original String used to create this <code>Expression</code>,
* unmodified.
- *
+ *
* <p>
* This is used for debugging purposes but also for the purposes of
* comparison (e.g. to ensure the expression in a configuration file has not
* changed).
* </p>
- *
+ *
* <p>
* This method does not provide sufficient information to re-create an
* expression. Two different expressions can have exactly the same
* expression string but different function mappings. Serialization should
* be used to save and restore the state of an <code>Expression</code>.
* </p>
- *
+ *
* @return The original expression String.
- *
+ *
* @see javax.el.Expression#getExpressionString()
*/
+ @Override
public String getExpressionString() {
return this.expr;
}
@@ -181,7 +182,7 @@
/**
* Evaluates the expression relative to the provided context, and returns
* information about the actual referenced method.
- *
+ *
* @param context
* The context of this evaluation
* @return an instance of <code>MethodInfo</code> containing information
@@ -200,6 +201,7 @@
* the cause property of this exception, if available.
* @see javax.el.MethodExpression#getMethodInfo(javax.el.ELContext)
*/
+ @Override
public MethodInfo getMethodInfo(ELContext context)
throws PropertyNotFoundException, MethodNotFoundException,
ELException {
@@ -222,7 +224,7 @@
/**
* Returns the hash code for this <code>Expression</code>.
- *
+ *
* <p>
* See the note in the {@link #equals} method on how two expressions can be
* equal if their expression Strings are different. Recall that if two
@@ -231,12 +233,13 @@
* objects must produce the same integer result. Implementations must take
* special note and implement <code>hashCode</code> correctly.
* </p>
- *
+ *
* @return The hash code for this <code>Expression</code>.
* @see #equals
* @see java.util.Hashtable
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getNode().hashCode();
}
@@ -245,7 +248,7 @@
* Evaluates the expression relative to the provided context, invokes the
* method that was found using the supplied parameters, and returns the
* result of the method invocation.
- *
+ *
* @param context
* The context of this evaluation.
* @param params
@@ -271,6 +274,7 @@
* @see javax.el.MethodExpression#invoke(javax.el.ELContext,
* java.lang.Object[])
*/
+ @Override
public Object invoke(ELContext context, Object[] params)
throws PropertyNotFoundException, MethodNotFoundException,
ELException {
@@ -284,9 +288,10 @@
/*
* (non-Javadoc)
- *
+ *
* @see java.io.Externalizable#readExternal(java.io.ObjectInput)
*/
+ @Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
this.expr = in.readUTF();
@@ -302,9 +307,10 @@
/*
* (non-Javadoc)
- *
+ *
* @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
*/
+ @Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeUTF(this.expr);
out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
@@ -314,6 +320,7 @@
out.writeObject(this.varMapper);
}
+ @Override
public boolean isLiteralText() {
return false;
}
diff --git a/impl/src/main/java/com/sun/el/ValueExpressionImpl.java b/impl/src/main/java/com/sun/el/ValueExpressionImpl.java
index ec99876..515acd7 100644
--- a/impl/src/main/java/com/sun/el/ValueExpressionImpl.java
+++ b/impl/src/main/java/com/sun/el/ValueExpressionImpl.java
@@ -30,11 +30,9 @@
import javax.el.PropertyNotFoundException;
import javax.el.PropertyNotWritableException;
import javax.el.ValueExpression;
-import javax.el.VariableMapper;
import javax.el.ValueReference;
-import javax.el.EvaluationListener;
+import javax.el.VariableMapper;
-import com.sun.el.lang.ELSupport;
import com.sun.el.lang.EvaluationContext;
import com.sun.el.lang.ExpressionBuilder;
import com.sun.el.parser.AstLiteralExpression;
@@ -43,7 +41,7 @@
/**
* An <code>Expression</code> that can get or set a value.
- *
+ *
* <p>
* In previous incarnations of this API, expressions could only be read.
* <code>ValueExpression</code> objects can now be used both to retrieve a
@@ -55,37 +53,37 @@
* details. Expressions that cannot be used as l-values must always return
* <code>true</code> from <code>isReadOnly()</code>.
* </p>
- *
+ *
* <p>
- * <code>The {@link ExpressionFactory#createValueExpression} method
+ * The {@link ExpressionFactory#createValueExpression} method
* can be used to parse an expression string and return a concrete instance
* of <code>ValueExpression</code> that encapsulates the parsed expression.
- * The {@link FunctionMapper} is used at parse time, not evaluation time,
- * so one is not needed to evaluate an expression using this class.
+ * The {@link FunctionMapper} is used at parse time, not evaluation time,
+ * so one is not needed to evaluate an expression using this class.
* However, the {@link ELContext} is needed at evaluation time.</p>
*
* <p>The {@link #getValue}, {@link #setValue}, {@link #isReadOnly} and
* {@link #getType} methods will evaluate the expression each time they are
- * called. The {@link ELResolver} in the <code>ELContext</code> is used to
+ * called. The {@link ELResolver} in the <code>ELContext</code> is used to
* resolve the top-level variables and to determine the behavior of the
* <code>.</code> and <code>[]</code> operators. For any of the four methods,
- * the {@link ELResolver#getValue} method is used to resolve all properties
- * up to but excluding the last one. This provides the <code>base</code>
- * object. At the last resolution, the <code>ValueExpression</code> will
- * call the corresponding {@link ELResolver#getValue},
- * {@link ELResolver#setValue}, {@link ELResolver#isReadOnly} or
- * {@link ELResolver#getType} method, depending on which was called on
+ * the {@link ELResolver#getValue} method is used to resolve all properties
+ * up to but excluding the last one. This provides the <code>base</code>
+ * object. At the last resolution, the <code>ValueExpression</code> will
+ * call the corresponding {@link ELResolver#getValue},
+ * {@link ELResolver#setValue}, {@link ELResolver#isReadOnly} or
+ * {@link ELResolver#getType} method, depending on which was called on
* the <code>ValueExpression</code>.
* </p>
*
- * <p>See the notes about comparison, serialization and immutability in
+ * <p>See the notes about comparison, serialization and immutability in
* the {@link Expression} javadocs.
*
* @see javax.el.ELResolver
* @see javax.el.Expression
* @see javax.el.ExpressionFactory
* @see javax.el.ValueExpression
- *
+ *
* @author Jacob Hookom [jacob@hookom.net]
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: dochez $
*/
@@ -106,9 +104,6 @@
}
- /**
- *
- */
public ValueExpressionImpl(String expr, Node node, FunctionMapper fnMapper,
VariableMapper varMapper, Class expectedType) {
this.expr = expr;
@@ -120,9 +115,10 @@
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof ValueExpressionImpl) {
ValueExpressionImpl v = (ValueExpressionImpl) obj;
@@ -133,9 +129,10 @@
/*
* (non-Javadoc)
- *
+ *
* @see javax.el.ValueExpression#getExpectedType()
*/
+ @Override
public Class getExpectedType() {
return this.expectedType;
}
@@ -143,13 +140,14 @@
/**
* Returns the type the result of the expression will be coerced to after
* evaluation.
- *
+ *
* @return the <code>expectedType</code> passed to the
* <code>ExpressionFactory.createValueExpression</code> method
* that created this <code>ValueExpression</code>.
- *
+ *
* @see javax.el.Expression#getExpressionString()
*/
+ @Override
public String getExpressionString() {
return this.expr;
}
@@ -167,9 +165,10 @@
/*
* (non-Javadoc)
- *
+ *
* @see javax.el.ValueExpression#getType(javax.el.ELContext)
*/
+ @Override
public Class getType(ELContext context) throws PropertyNotFoundException,
ELException {
EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
@@ -179,9 +178,10 @@
/*
* (non-Javadoc)
- *
+ *
* @see javax.el.ValueExpression#getValueReference(javax.el.ELContext)
*/
+ @Override
public ValueReference getValueReference(ELContext context)
throws PropertyNotFoundException, ELException {
EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
@@ -191,9 +191,10 @@
/*
* (non-Javadoc)
- *
+ *
* @see javax.el.ValueExpression#getValue(javax.el.ELContext)
*/
+ @Override
public Object getValue(ELContext context) throws PropertyNotFoundException,
ELException {
EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
@@ -213,18 +214,20 @@
/*
* (non-Javadoc)
- *
+ *
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getNode().hashCode();
}
/*
* (non-Javadoc)
- *
+ *
* @see javax.el.ValueExpression#isLiteralText()
*/
+ @Override
public boolean isLiteralText() {
try {
return this.getNode() instanceof AstLiteralExpression;
@@ -235,9 +238,10 @@
/*
* (non-Javadoc)
- *
+ *
* @see javax.el.ValueExpression#isReadOnly(javax.el.ELContext)
*/
+ @Override
public boolean isReadOnly(ELContext context)
throws PropertyNotFoundException, ELException {
EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
@@ -245,6 +249,7 @@
return this.getNode().isReadOnly(ctx);
}
+ @Override
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
this.expr = in.readUTF();
@@ -258,10 +263,11 @@
/*
* (non-Javadoc)
- *
+ *
* @see javax.el.ValueExpression#setValue(javax.el.ELContext,
* java.lang.Object)
*/
+ @Override
public void setValue(ELContext context, Object value)
throws PropertyNotFoundException, PropertyNotWritableException,
ELException {
@@ -270,6 +276,7 @@
this.getNode().setValue(ctx, value);
}
+ @Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeUTF(this.expr);
out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
@@ -278,6 +285,7 @@
out.writeObject(this.varMapper);
}
+ @Override
public String toString() {
return "ValueExpression["+this.expr+"]";
}
diff --git a/impl/src/main/java/com/sun/el/lang/ELSupport.java b/impl/src/main/java/com/sun/el/lang/ELSupport.java
index 945bf44..dfd786b 100644
--- a/impl/src/main/java/com/sun/el/lang/ELSupport.java
+++ b/impl/src/main/java/com/sun/el/lang/ELSupport.java
@@ -21,7 +21,6 @@
import java.math.BigDecimal;
import java.math.BigInteger;
-import javax.el.ELContext;
import javax.el.ELException;
import javax.el.PropertyNotFoundException;
@@ -29,7 +28,7 @@
/**
* A helper class that implements the EL Specification
- *
+ *
* @author Jacob Hookom [jacob@hookom.net]
* @author Kin-man Chung
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: kchung $
@@ -53,7 +52,7 @@
* @param obj0 First object to be compared
* @param obj1 Second object to be compared
* @return The result (an int with values -1, 0, or 1) of the comparison
- * @throws EvaluationException
+ * @throws ELException when something goes wrong
*/
public final static int compare(final Object obj0, final Object obj1)
throws ELException {
@@ -102,7 +101,7 @@
* @param obj0 Fisrt object to be compared
* @param obj1 Second object to be compared
* @return true if the objects compared equal
- * @throws EvaluationException
+ * @throws ELException when something goes wrong
*/
public final static boolean equals(final Object obj0, final Object obj1)
throws ELException {
@@ -389,7 +388,7 @@
}
if (obj == null) {
- return null;
+ return null;
}
if (obj instanceof String) {
@@ -496,7 +495,7 @@
}
/**
- *
+ *
*/
public ELSupport() {
super();