/** * Validates the given Object. * * @param object the Object to validate * @param context the ValidationContext * @throws ValidationException if the given String is not matched by the regular expression * pattern */ public void validate(final Object object, final ValidationContext context) throws ValidationException { if (object == null) { if (!_nillable) { String err = resourceBundle.getString("patternValidator.error.cannot.validate.null.object"); throw new ValidationException(err); } return; } validate(object.toString(), context); }
/** * Validates the given Object. * * @param object * the Object to validate * @param context * the ValidationContext * @throws ValidationException * if the given String is not matched by the regular expression * pattern */ public void validate(final Object object, final ValidationContext context) throws ValidationException { if (object == null) { if (!_nillable) { String err = "PatternValidator cannot validate a null object."; throw new ValidationException(err); } return; } validate(object.toString(), context); } // -- validate
/** * Validates the given Object. * * @param b * the boolean to validate * @param context * the ValidationContext * @throws ValidationException if the object fails validation. */ public void validate(final boolean b, final ValidationContext context) throws ValidationException { if (_useFixed && b != _fixed) { String err = "boolean " + b + " is not equal to the fixed value: " + _fixed; throw new ValidationException(err); } if (hasPattern()) { super.validate(new Boolean(b).toString(), context); } } //-- validate
/** * Validates the given Object. * * @param b the boolean to validate * @param context the ValidationContext * @throws ValidationException if the object fails validation. */ public void validate(final boolean b, final ValidationContext context) throws ValidationException { if (_useFixed && b != _fixed) { String err = "boolean " + b + " is not equal to the fixed value: " + _fixed; throw new ValidationException(err); } if (hasPattern()) { super.validate(String.valueOf(b), context); } } // -- validate
super.validate(value.toString(), context);
super.validate(value.toString(), context);
super.validate(Long.toString(value), context);
super.validate(Byte.toString(b), context);
super.validate(Short.toString(s), context);
super.validate(Integer.toString(i), context);
super.validate(Byte.toString(b), context);
super.validate(Long.toString(value), context);
super.validate(Integer.toString(i), context);
super.validate(Long.toString(i), context);
super.validate(value, context);
super.validate(value, context);
super.validate(Float.toString(d), context);
super.validate(Float.toString(d), context);
super.validate(Double.toString(d), context);
super.validate(Double.toString(d), context);