[forge-issues] [JBoss JIRA] (FORGE-1616) Command constraint-new-annotation to create a new constraint
George Gastaldi (JIRA)
issues at jboss.org
Wed Mar 12 13:23:10 EDT 2014
[ https://issues.jboss.org/browse/FORGE-1616?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
George Gastaldi closed FORGE-1616.
----------------------------------
Fix Version/s: 2.1.2.Final
(was: 2.x Future)
Resolution: Done
Merged, thanks!
> Command constraint-new-annotation to create a new constraint
> ------------------------------------------------------------
>
> Key: FORGE-1616
> URL: https://issues.jboss.org/browse/FORGE-1616
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.1.1.Final
> Reporter: Antonio Goncalves
> Assignee: Antonio Goncalves
> Labels: Starter
> Fix For: 2.1.2.Final
>
>
> The following command will create a *constraint annotation* with no implementation, and a default *error message* :
> {code}
> constraint-new-annotation --named URL
> {code}
> This command first creates the constraint annotation (notice validatedBy = {})
> {code}
> @Documented
> @Constraint(validatedBy = {})
> @Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
> @Retention(RUNTIME)
> @ReportAsSingleViolation
> public @interface URL {
> String message() default "Invalid value";
> Class<?>[] groups() default { };
> Class<? extends Payload>[] payload() default { };
> @Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
> @Retention(RUNTIME)
> @Documented
> public @interface List {
> URL[] value();
> }
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the forge-issues
mailing list