while (propertyNames.hasNext())
{
String propertyName = (String) propertyNames.next();
// Get the Field associated with that property in the Form
Field field = form.getField(propertyName);
// Look up the formatted name of the field from the Field arg0
String prettyFieldName = propertyName; //apps.getString(field.getArg(0).getKey());
// Get the result of validating the property.
ValidatorResult result = results.getValidatorResult(propertyName);
// Get all the actions run against the property, and iterate over
// their names.
Map actionMap = result.getActionMap();
Iterator keys = actionMap.keySet().iterator();
while (keys.hasNext())
{
String actName = (String) keys.next();
// Get the Action for that name.
ValidatorAction action = resources.getValidatorAction(actName);
// If the result is valid, print PASSED, otherwise print FAILED
System.out.println(propertyName + "[" + actName + "] ("
+ (result.isValid(actName) ? "PASSED" : "FAILED") + ")");
//If the result failed, format the Action's message against the
// formatted field name
if (!result.isValid(actName))
{
success = false;
String message = "invalid field"; // apps.getString(action.getMsg());
if (actName.equals("doubleRange"))
{
Arg f1 = field.getArg(1);
Arg f2 = field.getArg(2);
Arg f0 = field.getArg(0);
Object[] args =
{ prettyFieldName, field.getVar("min").getValue(), field.getVar("max").getValue()};
System.out.println(" Error message will be: " + MessageFormat.format(message, args));
}
else
{
Object[] args =