[forge-issues] [JBoss JIRA] (FORGE-1801) Being able to add a custom annotation to a property

Antonio Goncalves (JIRA) issues at jboss.org
Fri May 9 07:15:58 EDT 2014


Antonio Goncalves created FORGE-1801:
----------------------------------------

             Summary: Being able to add a custom annotation to a property
                 Key: FORGE-1801
                 URL: https://issues.jboss.org/browse/FORGE-1801
             Project: Forge
          Issue Type: Sub-task
          Components: Java EE
    Affects Versions: 2.5.0.Final
            Reporter: Antonio Goncalves
             Fix For: 2.x Future


With [FORGE-1616] I can now create my own constraint. For example, this is the way I create an ISBN constraint : 

{code}
constraint-new-annotation --named ISBN
{code}

The constraint is created, by default, under the {{constraint}} package. Now the problem, is that I can't apply it to a property because the constraint is not known. If I add a constraint, and press TAB for completion, ISBN does not appear : 

{code}
[Book.java]$ constraint-add --onProperty isbn --constraint TAB
Valid  Null  NotNull  AssertTrue  AssertFalse  Min  Max  DecimalMin  DecimalMax  Size  Digits  Past  Future  Pattern
{code}

Even if I try to add the location of the constraint, it does not work :
{code}
[Book.java]$ constraint-add --onProperty isbn --constraint ../constraints/ISBN

[0] - Valid
[1] - Null
[2] - NotNull
[3] - AssertTrue
[4] - AssertFalse
[5] - Min
[6] - Max
[7] - DecimalMin
[8] - DecimalMax
[9] - Size
[10] - Digits
[11] - Past
[12] - Future
[13] - Pattern

***ERROR*** Constraint must be specified.
{code}




--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the forge-issues mailing list