"long".equals(itype) || "double".equals(itype);
if (bdef.isInput()) {
// define strategy for adding items to collection
if (aname != null) {
ClassItem meth = cf.getBestMethod(aname,
null, new String[] { itype });
if (meth == null) {
ctx.throwStartTagException
("Add method " + aname +
" not found in collection type " +
cf.getName());
}
boolean hasval =
!"void".equals(meth.getTypeName());
store = new NestedCollection.AddStore(meth,
isdoub, hasval);
} else if (stname != null) {
ClassItem meth = cf.getBestMethod(stname,
null, new String[] { "int", itype });
if (meth == null) {
ctx.throwStartTagException
("Indexed store method " + stname +
" not found in collection type " +
cf.getName());
}
boolean hasval =
!"void".equals(meth.getTypeName());
store = new NestedCollection.IndexedStore(meth,
isdoub, hasval);
} else if (cf.isArray()) {
store = new NestedCollection.ArrayStore(itype,
isdoub);
} else {
ctx.throwStartTagException
("Unknown collection " +
"type with no add or store method defined");
}
}
if (bdef.isOutput()) {
// define strategy for loading items from collection
if (lname != null) {
ClassItem smeth = cf.getMethod(szname, "()I");
if (smeth == null) {
ctx.throwStartTagException
("Size method " + szname +
" not found in collection type " +
cf.getName());
}
ClassItem lmeth = cf.getBestMethod(lname,
itype, new String[] { "int" });
if (lmeth == null) {
ctx.throwStartTagException
("Load method " + lname +
" not found in collection type " +
cf.getName());
}
load = new NestedCollection.
IndexedLoad(smeth, isdoub, lmeth);
} else if (iname != null) {
String mname = "hasNext";
String nname = "next";
ClassItem meth = cf.getMethod(iname,
"()Ljava/util/Iterator;");
if (meth == null) {
mname = "hasMoreElements";
nname = "nextElement";
meth = cf.getMethod(iname,