Author: bayard
Date: Sat Jul 3 19:39:02 2010
New Revision: 960261
URL: http://svn.apache.org/viewvc?rev=960261&view=rev
Log:
Improved javadoc per Jeremy's #49542 patch
Modified:
tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java
Modified:
tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java
URL:
http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java?rev=960261&r1=960260&r2=960261&view=diff
==============================================================================
---
tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java
(original)
+++
tomcat/taglibs/standard/trunk/spec/src/main/java/javax/servlet/jsp/jstl/core/IteratedExpression.java
Sat Jul 3 19:39:02 2010
@@ -30,6 +30,9 @@ import java.util.Vector;
import javax.el.ELContext;
import javax.el.ValueExpression;
+/**
+ * Helper class for accessing members of a deferred expression result by index.
+ */
public final class IteratedExpression {
protected final ValueExpression orig;
protected final String delims;
@@ -38,12 +41,25 @@ public final class IteratedExpression {
private int currentIndex=0;
private enum TypesEnum {Undefined, ACollection, AnIterator, AnEnumeration,
AMap, AString};
private TypesEnum type = TypesEnum.Undefined;
-
- public IteratedExpression(ValueExpression valueExpression, String
stringTokenSeparator) {
- orig = valueExpression;
- delims = stringTokenSeparator;
+
+ /**
+ * Constructor specifying the expression to access.
+ * If the expression evaluates to a String, then it will be split using
the specified delimiters.
+ * @param orig the original expression to be accessed
+ * @param delims delimiters to be used to split a String result
+ */
+ public IteratedExpression(ValueExpression orig, String delims) {
+ this.orig = orig;
+ this.delims = delims;
}
-
+
+ /**
+ * Iterates the original expression and returns the value at the index.
+ *
+ * @param context against which the expression should be evaluated
+ * @param i the index of the value to return
+ * @return the value at the index
+ */
public Object getItem(ELContext context, int i) {
if (originalListObject == null) {
originalListObject = orig.getValue(context);
@@ -77,7 +93,12 @@ public final class IteratedExpression {
}
return currentObject;
}
-
+
+ /**
+ * Returns the original expression.
+ *
+ * @return the original expression
+ */
public ValueExpression getValueExpression() {
return orig;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]