msg += fields.size();
msg += " field(s) found with name >" + getName() + "<";
if (getPage() != ANY_PAGE)
msg += " on page " + getPage();
final StepFailedException sfe = new StepFailedException(msg);
final List availableFiels;
if (getPage() == ANY_PAGE)
availableFiels = pdfPage.getFields();
else
availableFiels = pdfPage.getFields(getPage());
if (availableFiels.isEmpty())
sfe.addDetail("available fields", "- none -");
else
{
final StringBuffer sb = new StringBuffer();
for (final Iterator iter=availableFiels.iterator(); iter.hasNext();)
{
final PDFField field = (PDFField) iter.next();
sb.append(field.getName());
sb.append("\n");
}
sfe.addDetail("available fields", sb.toString());
}
throw sfe;
}
}