package com.coding.thoughtworks.Validator;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.springframework.util.StringUtils;
import com.coding.thoughtworks.Annotation.Phone;

public class PhoneConstraintValidator implements ConstraintValidator<Phone, String>{
	
	public void initialize(Phone phone) {
		// TODO Auto-generated method stub
	}

	@Override
	public boolean isValid(String phoneField, ConstraintValidatorContext context) {
		if(StringUtils.isEmpty(phoneField)){
			return false;
		}
		/*
		 * Use a Regular expression to check the valid-ity of our phone field
		 */
		return phoneField.matches("[0-9()-]*");
	}

}

@@ -359,45 +359,8 @@
 ) %7B%0A
-%09%09// TODO Auto-generated method stub%0A
 %09%7D%0A%0A

Clean up of code