[ 
http://www.stripesframework.org/jira/browse/STS-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11707#action_11707
 ] 

Angel Ruiz commented on STS-316:
--------------------------------

What for? It is already written. Look at the attached files!

Cheers.

> Patch: pluggable annotation support for stripes
> -----------------------------------------------
>
>                 Key: STS-316
>                 URL: http://www.stripesframework.org/jira/browse/STS-316
>             Project: Stripes
>          Issue Type: New Feature
>          Components: Validation
>            Reporter: Ignacio Coloma
>         Attachments: jpa-v2.zip, pluggable-annotation-support.zip
>
>
> This is an attempt to give support for JPA annotations from inside Stripes. 
> Enclosed is a patch that does the following:
> 1.- Convert the annotation mechanism of stripes to be pluggable, and 
> therefore not limited to @Validate and @ValidateNestedProperties. In the line 
> of scratching my itch, I have implemented a @ValidateNestedJpaProperties (I 
> know the name sucks). 
> 2.- There is an AnnotationConverter interface that translates any kind of 
> annotation to the internal Stripes representation (ValidationMetadata). For 
> example, the tag above will seek the nested attributes and convert standard 
> JPA annotations (required, length, etc) into stripes internal representation.
> 3.- These annotation converters are stackable, but I still have to figure the 
> desired behaviour. The idea is to allow this kind of situation:
> @ValidateNestedJpaProperties
> @ValidateNestedProperties(<fine tuning here>)
> private PersistentObject instance;
> Where the second annotation would override the first one(for example, 
> changing length or required of certain attributes). It is more or less 
> implemented, but I still don't have a very clear idea of the expected 
> behaviour.
> If this works, annotations would be pluggable: you can give support to 
> Hibernate Annotations, JPA annotations, webwork annotations, all inside 
> stripes and override certain parts.
> Caveats: configuration is not finished (only provided a default config with 
> Validate and ValidateNestedProperties annotations) and haven't checked fully 
> if something broke. Some more tests should be implemented, but they are easy. 
> Anyways, I wanted to submit this to get some feedback (this is only a 
> proposal that might not be accepted). The big size is because I need an ejb3 
> jar file to be able to test annotation support.
> Tim, your code is great!! Amazingly easy to understand.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to