From 547d1e809deb37bd401cae6d0a8d04220b354c4e Mon Sep 17 00:00:00 2001 From: dreamamit Date: Mon, 18 Mar 2013 23:16:16 -0300 Subject: [PATCH] Update PetValidator.java Added detailed comments to validate method --- .../samples/petclinic/web/PetValidator.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/springframework/samples/petclinic/web/PetValidator.java b/src/main/java/org/springframework/samples/petclinic/web/PetValidator.java index 7068dd878..557ae3688 100644 --- a/src/main/java/org/springframework/samples/petclinic/web/PetValidator.java +++ b/src/main/java/org/springframework/samples/petclinic/web/PetValidator.java @@ -24,9 +24,17 @@ import org.springframework.validation.Errors; * * @author Ken Krebs * @author Juergen Hoeller + * @author Amit Shejekan */ public class PetValidator { + /** + * Validator to validate new Pet information for correctness and completeness. + * Error object is set with error messages in case of any validation failures. + * + * @param Pet - Pet object containing new Pet information such as name, owner + * @return - The method sets the error object and does not return anything + */ public void validate(Pet pet, Errors errors) { String name = pet.getName(); if (!StringUtils.hasLength(name)) {