Revision: 9441
Author: [email protected]
Date: Wed Dec 15 17:32:29 2010
Log: Show the SampleValidator
http://code.google.com/p/google-web-toolkit/source/detail?r=9441

Modified:
 /wiki/BeanValidation.wiki

=======================================
--- /wiki/BeanValidation.wiki   Wed Dec 15 17:27:55 2010
+++ /wiki/BeanValidation.wiki   Wed Dec 15 17:32:29 2010
@@ -26,6 +26,29 @@
Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
 Set<ConstraintViolation<Person>> violations = validator.validate(person);
 }}}
+
+
+Follow this pattern to create a Validator for the object you want to validate at runtime. (see [http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/validation/src/com/google/gwt/sample/validation/client/SampleValidator.java SampleValidator.java])
+
+{{{
+public class SampleValidator extends AbstractValidator {
+
+  /**
+ * Validator marker for the Validation Sample project. Only the classes listed
+   * in the {...@link GwtValidation} annotation can be validated.
+   */
+  @GwtValidation(value = Person.class)
+  public interface GwtValidator extends Validator {
+  }
+
+  public SampleValidator() {
+    super((Validator) GWT.create(SampleValidator.GwtValidator.class));
+  }
+}
+}}}
+
+
+Add replace with tag in your gwt.xml file to tell GWT which validator to use


 == What is not supported ==

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to