Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.java.programmer Subject: What is the meaning of these two required fields Date: Thu, 30 Jul 2015 09:52:59 +0200 Organization: Decebal Computing Lines: 25 Message-ID: <87mvyersis.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="528adfd6ad074c92fdc6a7f8fb9e23d8"; logging-data="14662"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XU/Ysr0aSixWe3ozynFEnah4Z74zLO4I=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Homepage: http://www.decebal.nl/ Cancel-Lock: sha1:26IWonBr93QkiIrKgPf5dYz9edw= sha1:Wq4S32JeyP5uMNQ3l96+Ve1WWZM= Xref: csiph.com comp.lang.java.programmer:32204 I wrote my own annotation: // public @Documented @Constraint(validatedBy = {}) @Target({ FIELD }) @Retention(RUNTIME) @ReportAsSingleViolation @NotNull @Size(min = 1) public @interface NotEmpty { // default Class[] groups() default { }; String message() default "Field should be filled"; Class[] payload() default {}; } I understand the reason for message: that is the message for when there is a validation constraint. But what are the reasons for groups and payload? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof