fields = pdfPage.getFields(getName(), getPage(), PDFField.TEXTBOX);
if (getExists() != null) {
boolean exists = ConversionUtil.convertToBoolean(getExists(), true);
if (exists && fields.isEmpty())
throw new StepFailedException("No field found with name \"" + getName() + "\"");
else if (!exists && !fields.isEmpty())
throw new StepFailedException(fields.size() + " fields found with name \"" + getName() + "\"");
}
else
{
if (fields.isEmpty())
{
throw new StepFailedException("No text field named '" + getName() + "' found.");
}
boolean regex = ConversionUtil.convertToBoolean(getRegex(), false);
final IStringVerifier verifier = getVerifier(regex);
for (final Iterator iter = fields.iterator(); iter.hasNext();) {
final PDFField field = (PDFField) iter.next();
if (!verifier.verifyStrings(getValue(), field.getValue()))
throw new StepFailedException("Wrong field value", getValue(), field.getValue());
}
}
}