I'm looking for a nice clean way so that my javadocs given to a 3rd party
will show what validation is being done  for a bean's property.  It's
documented in a word document what validations _should_ be being done, but
it would be nice if that were also easily translated into javadocs from the
source.  My javadocs currently have a section that looks like:
------------------------------------------------------

public class SubmitEvent
extends java.lang.Object
implements java.io.Serializable

SubmitEvent contains data needed for submitting an event to the system. It
is a data transfer object that contains convenience methods to get the event
data, and the addresses.

Author:
    [EMAIL PROTECTED]
See Also:
    Serialized Form
------------------------------------------------------

Then there's a constructor summary, and a method summary, and method detail.
All the properties are private, so there's no section for that.  I guess it
would be nice if in the generated javadoc there were a properties section
sortof like:

Properties:
                                        Validation Rule         Validation
Parameter       Validation Value
                                        
        currentCity                     required                        
                                        max-length
max-length                      30
        currentState            required                        
                                        min-length
min-length                      2
                                        max-length
max-length                      2
                                        valid-values            valid-values
AK:AL:,etc.
        currentZip                      required
                                        max-length
max-length                      5
                                        min-length
min-length                      5
                                        int
                                        
etc, etc. I guess one challenge in being able to create something like this
(from the validation.xml and or javadoc comments in the code which are used
to generate the validation.xml) is that there's no place except the code
which ties a 

<var><var-name>max-length</var-name><var-value>30</var-value></var>

to a particular method in the class doing the validation, or a particular
rule name.  So, If each method in the Validator implementation has markup
saying what var-name(s) it uses, it would be possible to generate something
like this.  perhaps a more generalized <validationxml> task could put extra
tags on the <validator name=.. items indicating what var-names it uses and
then using xslt it could become pretty javadocs for a customer.  

Blah, my use of something like that is very small right now, so I'll just
shelve the idea.


> -----Original Message-----
> From: Erik Hatcher [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 09, 2003 7:59 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Xdoclet-user] OT - javadocs for field validation
> 
> 
> It's not really off-topic.  Are you looking to generate 
> validation.xml? 
>   I did this in a (semi-) Struts specific manner for the 
> <strutsvalidationxml> subtask.  What was done there could be 
> generalized a bit more to process non-ValidatorForm (i.e. any Java 
> bean) quite easily.
> 
>       Erik
> 
> 
> On Thursday, October 9, 2003, at 02:30  PM, Mark Lybarger wrote:
> 
> > OFF TOPIC -
> >
> > I'm using a data transfer object passed into an EJB that is 
> used by an
> > external client (web app developed by third party).  I'd like to 
> > document
> > the validation done on the input object.  The validation is 
> being done 
> > by
> > commons-validator, so the validation rules are embedded in 
> an xml file.
> > Does anyone have a good example of using javadocs to document the 
> > validation
> > being done on passed in parameters?  I've got some fairly complex 
> > validation
> > being done ranging from not null fields (required) to 
> requiredif (if 
> > some
> > other field exists), etc.
> >
> > Thanks!
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.522 / Virus Database: 320 - Release Date: 9/29/2003
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: SF.net Giveback Program.
> > SourceForge.net hosts over 70,000 Open Source Projects.
> > See the people who have HELPED US provide better services:
> > Click here: http://sourceforge.net/supporters.php
> > _______________________________________________
> > xdoclet-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> SourceForge.net hosts over 70,000 Open Source Projects.
> See the people who have HELPED US provide better services:
> Click here: http://sourceforge.net/supporters.php
> _______________________________________________
> xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.522 / Virus Database: 320 - Release Date: 9/29/2003
>  
> 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.522 / Virus Database: 320 - Release Date: 9/29/2003
 



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to