tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Gredler (JIRA)" <tapestry-...@jakarta.apache.org>
Subject [jira] Created: (TAPESTRY-1224) Add JPA-annotation-driven validator
Date Sat, 06 Jan 2007 22:28:27 GMT
Add JPA-annotation-driven validator
-----------------------------------

                 Key: TAPESTRY-1224
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1224
             Project: Tapestry
          Issue Type: New Feature
    Affects Versions: 4.1.1, 5.0
            Reporter: Daniel Gredler
            Priority: Minor


The trend in validation seems to be to annotate your domain object properties; the annotations
are then used by validation frameworks to validate the domain objects (see JPA / Hibernate
Validator / JSR 303 / AppFuse 2 / etc).

It'd be nice if Tapestry had a JpaValidator built in, which wouldn't be hard, except that
the Validator interface doesn't provide enough information in the validate( ) method:

public void validate(IFormComponent field, ValidationMessages messages, Object value) throws
ValidatorException

The options, as far as I can tell, would be:
 1. The Validator level is the wrong level at which to read the annotations; read them higher
up and assign multiple low-level validators (maxLength,required,maxValue,etc) at runtime.
But where?
 2. Provide the IBinding from which the value originated as an extra parameter in the validate(
) method, but let the validators check for whatever specific IBinding implementations they
are interested in via instanceof.
 3. Provide the IBinding from which the value originated as an extra parameter in the validate(
) method, and also enhance IBinding so that there is some standard way to access this sort
of extra info without worrying about the specific binding type.

Thoughts?

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Mime
View raw message