public java.util.Collection | match(java.lang.String value, java.lang.String name)Validates the given value against this Constraint .
Collection failed_constrained_list = new ArrayList();
if((value != null) && (value.length() != 0)) {
if (!( (value.equalsIgnoreCase("true")) || //NOI18N
(value.equalsIgnoreCase("false")))){ //NOI18N
String failureMessage = formatFailureMessage(toString(), value,
name);
String format = BundleReader.getValue(
"MSG_BooleanConstraint_Failure"); //NOI18N
Object[] arguments = new Object[]{"True", "False"}; //NOI18N
String genericFailureMessage =
MessageFormat.format(format, arguments);
failed_constrained_list.add(new ConstraintFailure(toString(),
value, name, failureMessage, genericFailureMessage));
}
}
return failed_constrained_list;
|