jvalid-devel Mailing List for Java Validation Library
Status: Alpha
Brought to you by:
mikewill_1998
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
(2) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Brett M. <br...@ne...> - 2001-04-20 02:49:39
|
> >> Thought I should post this to the list since we have some new blood :) > >> BTW, Welcome Brett! > > > > > > Hey there... couldn't not at least see what came of my articles ;-) > > Hope you like what you see so far :) And if you want commit access to > the repository just say the word and your in! Cool, and thanks. I'll let you know. For now, I'll just throw in my opinions here and there, as I'm swamped, but if things loosen up, I'll be hopping in with more time. Darn those full-time jobs ;-) <snip /> > > > > A couple of thoughts. First, it would make more sense to me to include the > > message element more closely with the constraint involved. This actually > > brings up something I've been thinking about: since we're now to the point > > of defining elements, and not just using the XML Schema ones, it might make > > sense to define a 'constraint' element that is the baseType for all > > constraints. Then you might have something like this: > > > > <attribute name="orderDate"> > > <jvalid:constraint uiName="Order Date" baseType="date"> > > <jvalid:minInclusive value="2/28/2001"> > > <errorMessage>The value ${value} is less than the minimum allowed > > value ${minInclusive} for ${uiName}</errorMessage> > > </jvalid:minInclusive> > > </jvalid:constraint> > > </attribute> > > > > Something like that... so jvalid:constraint would extend XML Schema's > > constraint element, jvalid:minInclusive would extend XML Schema's > > minInclusive, etc. That sort of consolidates the UI Name with the name of > > the element/attribute, which makes more sense to me. It also allows the > > error message to be a part of the constraint, which also rings truer. > > > > My 2 cents ;-) Whatcha think? > > > > -Brett > > I like! It does make much more sense this way. My idea was basically > conceived as it was written.., usually not a very good idea.., but, can > spark some lively and productive discussions :) Note to self.., think > before posting! :) Hey, I don't follow that rule myself... just happens that I've been thinking about this topic since before I wrote the first article, so I've got a few months head start. I like the idea though... I'll watch the impl and see if I can continue to be of some help. -Brett > > Mike > > > _______________________________________________ > Jvalid-devel mailing list > Jva...@li... > http://lists.sourceforge.net/lists/listinfo/jvalid-devel |
From: Mike W. <mik...@st...> - 2001-04-20 02:40:22
|
Brett McLaughlin wrote: > ----- Original Message ----- > From: "Mike Williams" <mik...@st...> > To: <jva...@li...> > Sent: Thursday, April 19, 2001 8:38 PM > Subject: [Jvalid-devel] User defined messaging? > > > >> Thought I should post this to the list since we have some new blood :) >> BTW, Welcome Brett! > > > Hey there... couldn't not at least see what came of my articles ;-) Hope you like what you see so far :) And if you want commit access to the repository just say the word and your in! > > >> Mark and I were discussing ways of adding user defined messagging to >> JValid. Here is one idea that sounds like it would work. Feed back is >> welcome! > > > I'll give you what I can. I may be a little loopy... I'm in my normal frenzy > this time of year, as its the Stanley Cup Playoffs, and my Dallas Stars are > on tonight ;-) Good luck :) > > >> Here is the proposed change to the xml. The new attributes are >> friendlyName, minInclusiveMessage and maxInclusiveMessage. There would >> be a matching ??Message attribute for each possible validation error. >> The strings enclosed in {{ }} would be replaced at runtime with the >> appropriate values. >> >> <attribute name="orderDate"> >> <simpleType baseType="date"> >> <minInclusive value="2/28/2001" /> >> <maxInclusive value="5/28/2001" /> >> </simpleType> >> <friendlyName value="Order Date" /> >> <minInclusiveMessage value="The value {{value}} is less than the >> minimum allowed value {{minInclusive}} for {{friendlyName}}." /> >> <maxInclusiveMessage value="The value {{value}} is greater than the >> maximum allowed value {{maxInclusive}} for {{friendlyName}}." /> >> </attribute> > > > A couple of thoughts. First, it would make more sense to me to include the > message element more closely with the constraint involved. This actually > brings up something I've been thinking about: since we're now to the point > of defining elements, and not just using the XML Schema ones, it might make > sense to define a 'constraint' element that is the baseType for all > constraints. Then you might have something like this: > > <attribute name="orderDate"> > <jvalid:constraint uiName="Order Date" baseType="date"> > <jvalid:minInclusive value="2/28/2001"> > <errorMessage>The value ${value} is less than the minimum allowed > value ${minInclusive} for ${uiName}</errorMessage> > </jvalid:minInclusive> > </jvalid:constraint> > </attribute> > > Something like that... so jvalid:constraint would extend XML Schema's > constraint element, jvalid:minInclusive would extend XML Schema's > minInclusive, etc. That sort of consolidates the UI Name with the name of > the element/attribute, which makes more sense to me. It also allows the > error message to be a part of the constraint, which also rings truer. > > My 2 cents ;-) Whatcha think? > > -Brett I like! It does make much more sense this way. My idea was basically conceived as it was written.., usually not a very good idea.., but, can spark some lively and productive discussions :) Note to self.., think before posting! :) Mike |
From: Brett M. <br...@ne...> - 2001-04-20 01:52:07
|
----- Original Message ----- From: "Mike Williams" <mik...@st...> To: <jva...@li...> Sent: Thursday, April 19, 2001 8:38 PM Subject: [Jvalid-devel] User defined messaging? > Thought I should post this to the list since we have some new blood :) > BTW, Welcome Brett! Hey there... couldn't not at least see what came of my articles ;-) > > Mark and I were discussing ways of adding user defined messagging to > JValid. Here is one idea that sounds like it would work. Feed back is > welcome! I'll give you what I can. I may be a little loopy... I'm in my normal frenzy this time of year, as its the Stanley Cup Playoffs, and my Dallas Stars are on tonight ;-) > > Here is the proposed change to the xml. The new attributes are > friendlyName, minInclusiveMessage and maxInclusiveMessage. There would > be a matching ??Message attribute for each possible validation error. > The strings enclosed in {{ }} would be replaced at runtime with the > appropriate values. > > <attribute name="orderDate"> > <simpleType baseType="date"> > <minInclusive value="2/28/2001" /> > <maxInclusive value="5/28/2001" /> > </simpleType> > <friendlyName value="Order Date" /> > <minInclusiveMessage value="The value {{value}} is less than the > minimum allowed value {{minInclusive}} for {{friendlyName}}." /> > <maxInclusiveMessage value="The value {{value}} is greater than the > maximum allowed value {{maxInclusive}} for {{friendlyName}}." /> > </attribute> A couple of thoughts. First, it would make more sense to me to include the message element more closely with the constraint involved. This actually brings up something I've been thinking about: since we're now to the point of defining elements, and not just using the XML Schema ones, it might make sense to define a 'constraint' element that is the baseType for all constraints. Then you might have something like this: <attribute name="orderDate"> <jvalid:constraint uiName="Order Date" baseType="date"> <jvalid:minInclusive value="2/28/2001"> <errorMessage>The value ${value} is less than the minimum allowed value ${minInclusive} for ${uiName}</errorMessage> </jvalid:minInclusive> </jvalid:constraint> </attribute> Something like that... so jvalid:constraint would extend XML Schema's constraint element, jvalid:minInclusive would extend XML Schema's minInclusive, etc. That sort of consolidates the UI Name with the name of the element/attribute, which makes more sense to me. It also allows the error message to be a part of the constraint, which also rings truer. My 2 cents ;-) Whatcha think? -Brett > > -- > > > ---------------------------- > Mike Williams > mik...@st... > http://www.mikesbox.com > ---------------------------- > May the Source be with you! > ---------------------------- > > > _______________________________________________ > Jvalid-devel mailing list > Jva...@li... > http://lists.sourceforge.net/lists/listinfo/jvalid-devel |
From: Mike W. <mik...@st...> - 2001-04-20 01:38:27
|
Thought I should post this to the list since we have some new blood :) BTW, Welcome Brett! Mark and I were discussing ways of adding user defined messagging to JValid. Here is one idea that sounds like it would work. Feed back is welcome! Here is the proposed change to the xml. The new attributes are friendlyName, minInclusiveMessage and maxInclusiveMessage. There would be a matching ??Message attribute for each possible validation error. The strings enclosed in {{ }} would be replaced at runtime with the appropriate values. <attribute name="orderDate"> <simpleType baseType="date"> <minInclusive value="2/28/2001" /> <maxInclusive value="5/28/2001" /> </simpleType> <friendlyName value="Order Date" /> <minInclusiveMessage value="The value {{value}} is less than the minimum allowed value {{minInclusive}} for {{friendlyName}}." /> <maxInclusiveMessage value="The value {{value}} is greater than the maximum allowed value {{maxInclusive}} for {{friendlyName}}." /> </attribute> -- ---------------------------- Mike Williams mik...@st... http://www.mikesbox.com ---------------------------- May the Source be with you! ---------------------------- |
From: Mike W. <mik...@st...> - 2001-03-23 03:08:01
|
Just testing the list. I sent a message to it yesterday and it didn't seem to go through :( -- ---------------------------- Mike Williams mik...@st... http://www.mikesbox.com ---------------------------- May the Source be with you! ---------------------------- |
From: Mike W. <mik...@st...> - 2001-03-22 00:49:32
|
I think I may have a solution that I want to bounce off you. We could provide two methods of validation. The current one validate( "<Contraint_Name>", value ) and one more that will return an object representing the native value. The second method would take the same parameters as validate but would return an object. The returned object would be one of the native wrapper classes or in the case of a date an instance of the Date class. An exception would be thrown if the value fails the validation. The exception would provide a getErrorList method that will return the normal List of errors. If you simply called getMessage() it would collect all the errors in the list and return them as a string. I believe this would give us the best of both worlds! Plus, my earlier reservations would be taken care of :) We would still have a clean simple solution and it would be more flexible. If all you care about is validation you call validate and check the ErrorList for errors. If you want the value you call getObject( "<Contraint_Name>", value ), catch the exception and cast the returned object to your expected data type. Here's an example (Probably need to come up with a better name for the Exception :) try { Date orderDate = (Date) validator.getObject( "OrderDate", testDate ); //------------------------------- // Data was valid so do something with it :) //------------------------------- } catch ( ScrewedUpDataException sud ) { List errorList = sud.getErrorList(); //----------------------- // Do something with the errors. //----------------------- } |