-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: possibility for parameter annotations?
PostPosted: Tue Apr 01, 2008 3:38 pm 
Newbie

Joined: Sun Mar 30, 2008 12:19 am
Posts: 15
I was wondering if being able to leverage the annotations for parameter calls would be considered out of scope for 303, for example, say my web framework mapped functions to URL endpoints and parameters to query/post parameters:

Code:
@Valid
String doLogin(@NotNull @Length(16) String username, @NotNull @Length(16) String password) { ... }


Assuming the annotations were valid on parameters, processing might look something like this pseudocode:

Code:
value process(Method method, HttpServletRequest request ) {
   if (method annotated with Valid) {
      for (each parameter on method) {
          create or lookup validator appropriate to method and given annotations
          run annotations through
          alter any returned invalid constraints to represent the parameter name in their path
          append returned invalid constraints to master set
       }
   }
   if (any invalid constraints found) {
      throw exception to switch to handle invalid parameters
   }
   invoke method with parameters and return appropriate result
}


However, today this would have to build some sort of model objects, as parameters cannot have the standard annotations.[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 03, 2008 1:56 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
While out of the initial scope, this is something we will offer hooks for if time permits. These hooks will be used by AOP fwks or interceptor based application frameworks.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.