/** * Validates the given Object. * * @param object * the Object to validate * @throws ValidationException if the object fails validation. */ public void validate(final Object object) throws ValidationException { validate(object, (ValidationContext) null); } // -- validate
if (hasPattern()) { super.validate(Long.toString(value), context);
typeValidator = new org.exolab.castor.xml.validators.LongValidator(); fieldValidator.setValidator(typeValidator);
if (hasPattern()) { super.validate(Long.toString(value), context);
typeValidator = new org.exolab.castor.xml.validators.LongValidator(); fieldValidator.setValidator(typeValidator);
/** * Validates the given Object. * * @param object the Object to validate * @throws ValidationException if the object fails validation. */ public void validate(final Object object) throws ValidationException { validate(object, (ValidationContext) null); } // -- validate
/** * Validates the given Object. * * @param object the Object to validate * @param context the ValidationContext * @throws ValidationException if the object fails validation. */ public void validate(final Object object, final ValidationContext context) throws ValidationException { if (object == null) { String err = "LongValidator cannot validate a null object."; throw new ValidationException(err); } long value = 0; try { value = ((Long) object).longValue(); } catch (Exception ex) { String err = "Expecting a Long, received instead: "; err += object.getClass().getName(); throw new ValidationException(err); } validate(value, context); } // -- validate
/** * Validates the given Object. * * @param object * the Object to validate * @param context * the ValidationContext * @throws ValidationException if the object fails validation. */ public void validate(final Object object, final ValidationContext context) throws ValidationException { if (object == null) { String err = "LongValidator cannot validate a null object."; throw new ValidationException(err); } long value = 0; try { value = ((Long) object).longValue(); } catch (Exception ex) { String err = "Expecting a Long, received instead: "; err += object.getClass().getName(); throw new ValidationException(err); } validate(value, context); } // -- validate