net.sourceforge.annovalidator.builtin.validators
Class ValidateCompositeDate.CompositeDateValidator

java.lang.Object
  extended by net.sourceforge.annovalidator.builtin.validators.ValidateCompositeDate.CompositeDateValidator
Enclosing class:
ValidateCompositeDate

public static class ValidateCompositeDate.CompositeDateValidator
extends java.lang.Object

Class for validating objects annotated with the ValidateCompositeDate annotation.


Constructor Summary
ValidateCompositeDate.CompositeDateValidator()
           
 
Method Summary
 boolean validate(java.lang.Object target, DateUtil.CompositeDatePart[] dateParts, java.lang.String invalidDatePartErrorCode)
          Validates a composite date, with each of its parts specified by a different field in target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidateCompositeDate.CompositeDateValidator

public ValidateCompositeDate.CompositeDateValidator()
Method Detail

validate

public boolean validate(java.lang.Object target,
                        DateUtil.CompositeDatePart[] dateParts,
                        java.lang.String invalidDatePartErrorCode)
                 throws ReportedValidationException
Validates a composite date, with each of its parts specified by a different field in target.

Parameters:
target - The object containing the fields defined in dateParts.
dateParts - An array of CompositeDateParts defining all the fields in target that contain part of the date to be validated, and what part they contain.
invalidDatePartErrorCode - The error code to use if one of the date fields contains invalid data.
Returns:
true if all the date parts identified in dateParts can be used to make a valid date and time, otherwise false.
Throws:
ReportedValidationException - If one of the date fields contains an invalid value.


Copyright © 2008. All Rights Reserved.