Methods Summary |
---|
public java.lang.String | execute()
if (value == null) {
return ERROR;
} else {
values = new ArrayList();
if (separator != null) {
StringTokenizer tokens = new StringTokenizer(value.toString(), separator);
while (tokens.hasMoreTokens()) {
String token = tokens.nextToken().trim();
if (converter != null) {
try {
Object convertedObj = converter.convert(token);
values.add(convertedObj);
}
catch(Exception e) { // make sure things, goes on, we just ignore the bad ones
_log.warn("unable to convert ["+token+"], skipping this token, it will not appear in the generated iterator", e);
}
}
else {
values.add(token);
}
}
} else {
values.add(value.toString());
}
// Count default is the size of the list of values
if (count == 0) {
count = values.size();
}
return SUCCESS;
}
|
public boolean | getHasNext()
return hasNext();
|
public java.lang.Object | getNext()
return next();
|
public boolean | hasNext()
return (value == null) ? false : ((currentCount < count) || (count == -1));
|
public java.lang.Object | next()
try {
return values.get(currentCount % values.size());
} finally {
currentCount++;
}
|
public void | remove()
throw new UnsupportedOperationException("Remove is not supported in IteratorGenerator.");
|
public void | setConverter(org.apache.struts2.util.IteratorGenerator$Converter aConverter)
converter = aConverter;
|
public void | setCount(int aCount)
this.count = aCount;
|
public void | setSeparator(java.lang.String aChar)
separator = aChar;
|
public void | setValues(java.lang.Object aValue)
value = aValue;
|