This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch restful in repository https://gitbox.apache.org/repos/asf/struts-site.git
commit d24f3f67c5f77686d28d1efc8c97007cf950c70f Author: Lukasz Lenart <lukaszlen...@apache.org> AuthorDate: Fri Dec 8 09:25:38 2017 +0100 Cleans up annotations --- .../conversion-error-field-validator-annotation.md | 6 +- .../core-developers/custom-validator-annotation.md | 29 ++-------- .../date-range-field-validator-annotation.md | 32 +++-------- .../double-range-field-validator-annotation.md | 35 +++--------- .../core-developers/email-validator-annotation.md | 29 ++-------- .../expression-validator-annotation.md | 27 ++------- .../field-expression-validator-annotation.md | 31 +++------- .../int-range-field-validator-annotation.md | 37 +++--------- .../regex-field-validator-annotation.md | 29 ++-------- .../required-field-validator-annotation.md | 28 ++------- .../required-string-validator-annotation.md | 29 ++-------- .../string-length-field-validator-annotation.md | 35 +++--------- source/core-developers/url-validator-annotation.md | 66 ++++++++++------------ source/core-developers/validations-annotation.md | 49 ++++------------ .../visitor-field-validator-annotation.md | 41 ++++---------- 15 files changed, 132 insertions(+), 371 deletions(-) diff --git a/source/core-developers/conversion-error-field-validator-annotation.md b/source/core-developers/conversion-error-field-validator-annotation.md index 1501bf6..04c753d 100644 --- a/source/core-developers/conversion-error-field-validator-annotation.md +++ b/source/core-developers/conversion-error-field-validator-annotation.md @@ -1,6 +1,9 @@ --- -layout: core-developers +layout: default title: ConversionErrorFieldValidator Annotation +parent: + title: Annotations + url: annotations.html --- # ConversionErrorFieldValidator Annotation @@ -12,7 +15,6 @@ See [Type Conversion Error Handling](type-conversion.html#type-conversion-error- The `ConversionErrorFieldValidator` annotation must be applied at method level. - ## Parameters <p> <table class='confluenceTable' summary=''> diff --git a/source/core-developers/custom-validator-annotation.md b/source/core-developers/custom-validator-annotation.md index e51f448..36dba80 100644 --- a/source/core-developers/custom-validator-annotation.md +++ b/source/core-developers/custom-validator-annotation.md @@ -1,31 +1,21 @@ --- -layout: core-developers +layout: default title: CustomValidator Annotation +parent: + title: Annotations + url: annotations.html --- # CustomValidator Annotation - - -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.CustomValidator {% endcomment %} -<p> This annotation can be used for custom validators. Use the ValidationParameter annotation to supply additional params. -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.CustomValidator {% endcomment %} +This annotation can be used for custom validators. Use the ValidationParameter annotation to supply additional params. ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.CustomValidator {% endcomment %} -<p> <p>The annotation must be applied at method or type level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.CustomValidator {% endcomment %} +The annotation must be applied at method or type level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.CustomValidator {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> <th class='confluenceTh'> Parameter </th> @@ -71,21 +61,14 @@ title: CustomValidator Annotation </tr> </table> </p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.CustomValidator {% endcomment %} ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.CustomValidator {% endcomment %} - ```java @CustomValidator(type ="customValidatorName", fieldName = "myField") ``` -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.CustomValidator {% endcomment %} - ## Adding Parameters Use the [ValidationParameter annotation](validation-parameter-annotation.html) to add custom parameter values. diff --git a/source/core-developers/date-range-field-validator-annotation.md b/source/core-developers/date-range-field-validator-annotation.md index 5813224..f57ce81 100644 --- a/source/core-developers/date-range-field-validator-annotation.md +++ b/source/core-developers/date-range-field-validator-annotation.md @@ -1,31 +1,21 @@ --- -layout: core-developers +layout: default title: DateRangeFieldValidator Annotation +parent: + title: Annotations + url: annotations.html --- # DateRangeFieldValidator Annotation - - -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.DateRangeFieldValidator {% endcomment %} -<p> This validator checks that a date field has a value within a specified range. -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.DateRangeFieldValidator {% endcomment %} +This validator checks that a date field has a value within a specified range. ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.DateRangeFieldValidator {% endcomment %} -<p> <p>The annotation must be applied at method level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.DateRangeFieldValidator {% endcomment %} +The annotation must be applied at method level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.DateRangeFieldValidator {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> <th class='confluenceTh'> Parameter </th> @@ -107,19 +97,11 @@ title: DateRangeFieldValidator Annotation </tr> </table> - <p>If neither <em>min</em> nor <em>max</em> is set, nothing will be done.</p> -</p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.DateRangeFieldValidator {% endcomment %} +If neither `min` nor `max` is set, nothing will be done. ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.DateRangeFieldValidator {% endcomment %} - ```java @DateRangeFieldValidator(message = "Default message", key = "i18n.key", shortCircuit = true, min = "2005/01/01", max = "2005/12/31") ``` - -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.DateRangeFieldValidator {% endcomment %} diff --git a/source/core-developers/double-range-field-validator-annotation.md b/source/core-developers/double-range-field-validator-annotation.md index c4fb48d..4482a9c 100644 --- a/source/core-developers/double-range-field-validator-annotation.md +++ b/source/core-developers/double-range-field-validator-annotation.md @@ -1,32 +1,21 @@ --- -layout: core-developers +layout: default title: DoubleRangeFieldValidator Annotation +parent: + title: Annotations + url: annotations.html --- # DoubleRangeFieldValidator Annotation - - -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.DoubleRangeFieldValidator {% endcomment %} -<p> This validator checks that a double field has a value within a specified range. - If neither min nor max is set, nothing will be done. -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.DoubleRangeFieldValidator {% endcomment %} +This validator checks that a double field has a value within a specified range. If neither min nor max is set, nothing will be done. ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.DoubleRangeFieldValidator {% endcomment %} -<p> <p>The annotation must be applied at method level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.DoubleRangeFieldValidator {% endcomment %} +The annotation must be applied at method level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.DoubleRangeFieldValidator {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> <th class='confluenceTh'> Parameter </th> @@ -120,21 +109,13 @@ title: DoubleRangeFieldValidator Annotation </tr> </table> - <p>If neither <em>min</em> nor <em>max</em> is set, nothing will be done.</p> +If neither `min` nor `max` is set, nothing will be done. - <p>The values for min and max must be inserted as String values so that "0" can be handled as a possible value.</p> -</p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.DoubleRangeFieldValidator {% endcomment %} +The values for min and max must be inserted as String values so that "0" can be handled as a possible value. ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.DoubleRangeFieldValidator {% endcomment %} - ```java @DoubleRangeFieldValidator(message = "Default message", key = "i18n.key", shortCircuit = true, minInclusive = "0.123", maxInclusive = "99.987") ``` - -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.DoubleRangeFieldValidator {% endcomment %} diff --git a/source/core-developers/email-validator-annotation.md b/source/core-developers/email-validator-annotation.md index 5bd36b6..4e98625 100644 --- a/source/core-developers/email-validator-annotation.md +++ b/source/core-developers/email-validator-annotation.md @@ -1,31 +1,21 @@ --- -layout: core-developers +layout: default title: EmailValidator Annotation +parent: + title: Annotations + url: annotations.html --- # EmailValidator Annotation - - -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.EmailValidator {% endcomment %} -<p> This validator checks that a field is a valid e-mail address if it contains a non-empty String. -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.EmailValidator {% endcomment %} +This validator checks that a field is a valid e-mail address if it contains a non-empty String. ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.EmailValidator {% endcomment %} -<p> <p>The annotation must be applied at method level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.EmailValidator {% endcomment %} +The annotation must be applied at method level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.EmailValidator {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> <th class='confluenceTh'> Parameter </th> @@ -71,17 +61,10 @@ title: EmailValidator Annotation </tr> </table> </p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.EmailValidator {% endcomment %} ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.EmailValidator {% endcomment %} - ```java @EmailValidator(message = "Default message", key = "i18n.key", shortCircuit = true) ``` - -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.EmailValidator {% endcomment %} diff --git a/source/core-developers/expression-validator-annotation.md b/source/core-developers/expression-validator-annotation.md index 9042a01..17f19de 100644 --- a/source/core-developers/expression-validator-annotation.md +++ b/source/core-developers/expression-validator-annotation.md @@ -1,29 +1,21 @@ --- -layout: core-developers +layout: default title: ExpressionValidator Annotation +parent: + title: Annotations + url: annotations.html --- # ExpressionValidator Annotation -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.ExpressionValidator {% endcomment %} -<p> This non-field level validator validates a supplied regular expression. -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.ExpressionValidator {% endcomment %} +This non-field level validator validates a supplied regular expression. ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.ExpressionValidator {% endcomment %} -<p> <p>The annotation must be applied at method level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.ExpressionValidator {% endcomment %} +The annotation must be applied at method level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.ExpressionValidator {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> <th class='confluenceTh'> Parameter </th> @@ -63,17 +55,10 @@ title: ExpressionValidator Annotation </tr> </table> </p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.ExpressionValidator {% endcomment %} ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.ExpressionValidator {% endcomment %} - ```java @ExpressionValidator(message = "Default message", key = "i18n.key", shortCircuit = true, expression = "an OGNL expression" ) ``` - -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.ExpressionValidator {% endcomment %} diff --git a/source/core-developers/field-expression-validator-annotation.md b/source/core-developers/field-expression-validator-annotation.md index 8f6907f..e00fce9 100644 --- a/source/core-developers/field-expression-validator-annotation.md +++ b/source/core-developers/field-expression-validator-annotation.md @@ -1,32 +1,22 @@ --- -layout: core-developers +layout: default title: FieldExpressionValidator Annotation +parent: + title: Annotations + url: annotations.html --- # FieldExpressionValidator Annotation - -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator {% endcomment %} -<p> This validator uses an OGNL expression to perform its validator. - The error message will be added to the field if the expression returns - false when it is evaluated against the value stack. -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator {% endcomment %} +This validator uses an OGNL expression to perform its validator. The error message will be added to the field if the expression +returns false when it is evaluated against the value stack. ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator {% endcomment %} -<p> <p>The annotation must be applied at method level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator {% endcomment %} +The annotation must be applied at method level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> <th class='confluenceTh'> Parameter </th> @@ -72,17 +62,10 @@ title: FieldExpressionValidator Annotation </tr> </table> </p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator {% endcomment %} ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator {% endcomment %} - ```java @FieldExpressionValidator(message = "Default message", key = "i18n.key", shortCircuit = true, expression = "an OGNL expression") ``` - -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator {% endcomment %} diff --git a/source/core-developers/int-range-field-validator-annotation.md b/source/core-developers/int-range-field-validator-annotation.md index 1ff3b09..c825d6f 100644 --- a/source/core-developers/int-range-field-validator-annotation.md +++ b/source/core-developers/int-range-field-validator-annotation.md @@ -1,31 +1,22 @@ --- -layout: core-developers +layout: default title: IntRangeFieldValidator Annotation +parent: + title: Annotations + url: annotations.html --- # IntRangeFieldValidator Annotation - -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator {% endcomment %} -<p> This validator checks that a numeric field has a value within a specified range. - If neither min nor max is set, nothing will be done. -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator {% endcomment %} +This validator checks that a numeric field has a value within a specified range. If neither min nor max is set, +nothing will be done. ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator {% endcomment %} -<p> <p>The annotation must be applied at method level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator {% endcomment %} +The annotation must be applied at method level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> <th class='confluenceTh'> Parameter </th> @@ -101,23 +92,13 @@ title: IntRangeFieldValidator Annotation </tr> </table> - <p>If neither <em>min</em> nor <em>max</em> is set, nothing will be done.</p> - - <p>The values for min and max must be inserted as String values so that "0" can be handled as a possible value.</p> -</p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator {% endcomment %} +If neither `min` nor `max` is set, nothing will be done. ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator {% endcomment %} - ```java @IntRangeFieldValidator(message = "Default message", key = "i18n.key", shortCircuit = true, min = "0", max = "42") @IntRangeFieldValidator(message = "Default message", key = "i18n.key", shortCircuit = true, minExpression = "${minValue}", maxExpression = "${maxValue}") -``` - -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator {% endcomment %} +``` \ No newline at end of file diff --git a/source/core-developers/regex-field-validator-annotation.md b/source/core-developers/regex-field-validator-annotation.md index f251ccc..8857675 100644 --- a/source/core-developers/regex-field-validator-annotation.md +++ b/source/core-developers/regex-field-validator-annotation.md @@ -1,31 +1,21 @@ --- -layout: core-developers +layout: default title: RegexFieldValidator Annotation +parent: + title: Annotations + url: annotations.html --- # RegexFieldValidator Annotation - - -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RegexFieldValidator {% endcomment %} -<p> Validates a string field using a regular expression. -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RegexFieldValidator {% endcomment %} +Validates a string field using a regular expression. ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RegexFieldValidator {% endcomment %} -<p> <p>The annotation must be applied at method level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RegexFieldValidator {% endcomment %} +The annotation must be applied at method level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RegexFieldValidator {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> <th class='confluenceTh'> Parameter </th> @@ -77,17 +67,10 @@ title: RegexFieldValidator Annotation </tr> </table> </p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RegexFieldValidator {% endcomment %} ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.RegexFieldValidator {% endcomment %} - ```java @RegexFieldValidator( key = "regex.field", regex = "yourregexp") ``` - -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.RegexFieldValidator {% endcomment %} diff --git a/source/core-developers/required-field-validator-annotation.md b/source/core-developers/required-field-validator-annotation.md index 8ab882c..ee0225b 100644 --- a/source/core-developers/required-field-validator-annotation.md +++ b/source/core-developers/required-field-validator-annotation.md @@ -1,30 +1,21 @@ --- -layout: core-developers +layout: default title: RequiredFieldValidator Annotation +parent: + title: Annotations + url: annotations.html --- # RequiredFieldValidator Annotation - -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator {% endcomment %} -<p> This validator checks that a field is non-null. -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator {% endcomment %} +This validator checks that a field is non-null. ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator {% endcomment %} -<p> <p>The annotation must be applied at method level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator {% endcomment %} +The annotation must be applied at method level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> <th class='confluenceTh'> Parameter </th> @@ -70,17 +61,10 @@ title: RequiredFieldValidator Annotation </tr> </table> </p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator {% endcomment %} ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator {% endcomment %} - ```java @RequiredFieldValidator(message = "Default message", key = "i18n.key", shortCircuit = true) ``` - -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator {% endcomment %} diff --git a/source/core-developers/required-string-validator-annotation.md b/source/core-developers/required-string-validator-annotation.md index 3fe82b6..f66e4b6 100644 --- a/source/core-developers/required-string-validator-annotation.md +++ b/source/core-developers/required-string-validator-annotation.md @@ -1,31 +1,21 @@ --- -layout: core-developers +layout: default title: RequiredStringValidator Annotation +parent: + title: Annotations + url: annotations.html --- # RequiredStringValidator Annotation - - -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RequiredStringValidator {% endcomment %} -<p> This validator checks that a String field is not empty (i.e. non-null with a length > 0). -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RequiredStringValidator {% endcomment %} +This validator checks that a String field is not empty (i.e. non-null with a length > 0). ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RequiredStringValidator {% endcomment %} -<p> <p>The annotation must be applied at method level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RequiredStringValidator {% endcomment %} +The annotation must be applied at method level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RequiredStringValidator {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> <th class='confluenceTh'> Parameter </th> @@ -77,17 +67,10 @@ title: RequiredStringValidator Annotation </tr> </table> </p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.RequiredStringValidator {% endcomment %} ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.RequiredStringValidator {% endcomment %} - ```java @RequiredStringValidator(message = "Default message", key = "i18n.key", shortCircuit = true, trim = true) ``` - -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.RequiredStringValidator {% endcomment %} diff --git a/source/core-developers/string-length-field-validator-annotation.md b/source/core-developers/string-length-field-validator-annotation.md index bdb3c7b..b815e46 100644 --- a/source/core-developers/string-length-field-validator-annotation.md +++ b/source/core-developers/string-length-field-validator-annotation.md @@ -1,32 +1,22 @@ --- -layout: core-developers +layout: default title: StringLengthFieldValidator Annotation +parent: + title: Annotations + url: annotations.html --- # StringLengthFieldValidator Annotation - - -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator {% endcomment %} -<p> This validator checks that a String field is of the right length. It assumes that the field is a String. - If neither minLength nor maxLength is set, nothing will be done. -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator {% endcomment %} +This validator checks that a String field is of the right length. It assumes that the field is a String. +If neither minLength nor maxLength is set, nothing will be done. ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator {% endcomment %} -<p> <p>The annotation must be applied at method level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator {% endcomment %} +The annotation must be applied at method level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> <th class='confluenceTh'> Parameter </th> @@ -102,20 +92,11 @@ title: StringLengthFieldValidator Annotation </tr> </table> - <p>If neither <em>minLength</em> nor <em>maxLength</em> is set, nothing will be done.</p> - -</p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator {% endcomment %} +If neither `minLength` nor `maxLength` is set, nothing will be done. ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator {% endcomment %} - ```java @StringLengthFieldValidator(message = "Default message", key = "i18n.key", shortCircuit = true, trim = true, minLength = "5", maxLength = "12") ``` - -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator {% endcomment %} diff --git a/source/core-developers/url-validator-annotation.md b/source/core-developers/url-validator-annotation.md index cc6dfef..aee80c1 100644 --- a/source/core-developers/url-validator-annotation.md +++ b/source/core-developers/url-validator-annotation.md @@ -1,72 +1,64 @@ --- -layout: core-developers +layout: default title: UrlValidator Annotation +parent: + title: Annotations + url: annotations.html --- # UrlValidator Annotation -This validator checks that a field is a valid URL\. +This validator checks that a field is a valid URL. -Usage +## Usage - The annotation must be applied at method level\. + The annotation must be applied at method level. -Parameters +## Parameters | Parameter|Required|Default|Notes| |----------|--------|-------|-----| |message|yes| |field error message| |key|no| |i18n key from language specific properties file| -|messageParams|no| |additional params to be used to customize message \- will be evaluated against the Value Stack| +|messageParams|no| |additional params to be used to customize message - will be evaluated against the Value Stack| |fieldName|no| |field name under validation| |shortCircuit|no|false|if this validator should be used as shortCircuit| |urlRegex|no| |defines regex to use to validate url| |urlRegexExpression|no| |defines regex as expression to validate url, expression will be evaluated against current stack to get proper regex| -|type|yes|ValidatorType\.FIELD|Enum value from ValidatorType\. Either FIELD or SIMPLE can be used here| +|type|yes|ValidatorType.FIELD|Enum value from ValidatorType. Either FIELD or SIMPLE can be used here| -Examples +## Examples -**UrlValidator usage example** +### UrlValidator usage example - -~~~~~~~ +```java @UrlValidator(message = "Default message", key = "i18n.key", shortCircuit = true) -~~~~~~~ - -**UrlValidator usage example** +``` +### UrlValidator usage example -~~~~~~~ +```java @UrlValidator(message = "Default message", key = "i18n.key", urlRegexExpression = "${urlRegex}") -~~~~~~~ - - - -| urlRegex neither urlRegexExpression are only used on client side to validate URLs \- this will be changed with next major release\! - -| - - -If no urlRegex neither urlRegexExpression is defined, default regex will be used instead, based on [StackOverflow answer](http://stackoverflow\.com/questions/161738/what\-is\-the\-best\-regular\-expression\-to\-check\-if\-a\-string\-is\-a\-valid\-url)^[http://stackoverflow\.com/questions/161738/what\-is\-the\-best\-regular\-expression\-to\-check\-if\-a\-string\-is\-a\-valid\-url] - -| +``` -**Default URL regex** +If no `urlRegex` neither `urlRegexExpression` is defined, default regex will be used instead, +based on [StackOverflow answer](http://stackoverflow.com/questions/161738/what-is-the-best-regular-expression-to-check-if-a-string-is-a-valid-url) +### Default URL regex -~~~~~~~ +```java return "^(https?|ftp):\/\/" + - "(([a-z0-9$_\\.\\+!\\*\\'\\(\\),;\\?&=-]|%[0-9a-f]{2})+" + - "(:([a-z0-9$_\\.\\+!\\*\\'\\(\\),;\\?&=-]|%[0-9a-f]{2})+)?" + + "(([a-z0-9$_\.\\+!\\*\\'\\(\\),;\\?&=-]|%[0-9a-f]{2})+" + + "(:([a-z0-9$_\.\\+!\\*\\'\\(\\),;\\?&=-]|%[0-9a-f]{2})+)?" + "@)?(#?" + - ")((([a-z0-9]\\.|[a-z0-9][a-z0-9-]*[a-z0-9]\\.)*" + + ")((([a-z0-9]\.|[a-z0-9][a-z0-9-]*[a-z0-9]\.)*" + "[a-z][a-z0-9-]*[a-z0-9]" + - "|((\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\.){3}" + + "|((\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\.){3}" + "(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])" + ")(:\\d+)?" + - ")(((\\/+([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)*" + - "(\\?([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)" + + ")(((\\/+([a-z0-9$_\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)*" + + "(\\?([a-z0-9$_\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)" + "?)?)?" + - "(#([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)?" + + "(#([a-z0-9$_\.\\+!\\*\\'\\(\\),;:@&=-]|%[0-9a-f]{2})*)?" + "$"; -~~~~~~~ +``` diff --git a/source/core-developers/validations-annotation.md b/source/core-developers/validations-annotation.md index af7d24e..5d32417 100644 --- a/source/core-developers/validations-annotation.md +++ b/source/core-developers/validations-annotation.md @@ -1,30 +1,21 @@ --- -layout: core-developers +layout: default title: Validations Annotation +parent: + title: Annotations + url: annotations.html --- # Validations Annotation - -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.Validations {% endcomment %} -<p> <p>If you want to use several annotations of the same type, these annotations must be nested within the @Validations() annotation.</p> -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.Validations {% endcomment %} +If you want to use several annotations of the same type, these annotations must be nested within the `@Validations()` annotation. ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.Validations {% endcomment %} -<p> <p>Used at METHOD level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.Validations {% endcomment %} +Used at METHOD level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.Validations {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> @@ -101,14 +92,9 @@ title: Validations Annotation </tr> </table> </p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.Validations {% endcomment %} ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.Validations {% endcomment %} - ```java @Validations( requiredFields = @@ -143,32 +129,22 @@ title: Validations Annotation ``` -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.Validations {% endcomment %} - ## Different validations per method +Different validations per method is NOT supported for client-side validation! -Different validations per method is NOT supported for client\-side validation\! - -| - -To use different validations per method, the validateAnnotatedMethodOnly property must be set on the validation interceptor\. - - -~~~~~~~ +To use different validations per method, the `validateAnnotatedMethodOnly` property must be set on the validation interceptor. +```xml <interceptor-ref name="validation"> <param name="validateAnnotatedMethodOnly">true</param> <param name="excludeMethods">input,back,cancel,browse</param> </interceptor-ref> - -~~~~~~~ +``` Here's a complete example of updating the default stack: - -~~~~~~~ - +```xml <package name="default" extends="struts-default"> <interceptors> <interceptor-stack name="content"> @@ -201,5 +177,4 @@ Here's a complete example of updating the default stack: <default-interceptor-ref name="default"/> </package> </struts> - -~~~~~~~ +``` diff --git a/source/core-developers/visitor-field-validator-annotation.md b/source/core-developers/visitor-field-validator-annotation.md index ddcc366..9699562 100644 --- a/source/core-developers/visitor-field-validator-annotation.md +++ b/source/core-developers/visitor-field-validator-annotation.md @@ -1,38 +1,28 @@ --- -layout: core-developers +layout: default title: VisitorFieldValidator Annotation +parent: + title: Annotations + url: annotations.html --- # VisitorFieldValidator Annotation +The validator allows you to forward validator to object properties of your action +using the objects own validator files. This allows you to use the ModelDriven development +pattern and manage your validations for your models in one place, where they belong, next to +your model classes. - -{% comment %}start snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.VisitorFieldValidator {% endcomment %} -<p> The validator allows you to forward validator to object properties of your action - using the objects own validator files. This allows you to use the ModelDriven development - pattern and manage your validations for your models in one place, where they belong, next to - your model classes. - - The VisitorFieldValidator can handle either simple Object properties, Collections of Objects, or Arrays. - The error message for the VisitorFieldValidator will be appended in front of validator messages added - by the validations for the Object message. -</p> -{% comment %}end snippet id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.VisitorFieldValidator {% endcomment %} +The VisitorFieldValidator can handle either simple Object properties, Collections of Objects, or Arrays. +The error message for the VisitorFieldValidator will be appended in front of validator messages added +by the validations for the Object message. ## Usage - - -{% comment %}start snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.VisitorFieldValidator {% endcomment %} -<p> <p>The annotation must be applied at method level.</p> -</p> -{% comment %}end snippet id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.VisitorFieldValidator {% endcomment %} +The annotation must be applied at method level. ## Parameters - - -{% comment %}start snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.VisitorFieldValidator {% endcomment %} <p> <table class='confluenceTable' summary=''> <tr> <th class='confluenceTh'> Parameter </th> @@ -84,17 +74,10 @@ title: VisitorFieldValidator Annotation </tr> </table> </p> -{% comment %}end snippet id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.VisitorFieldValidator {% endcomment %} ## Examples - - -{% comment %}start snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.VisitorFieldValidator {% endcomment %} - ```java @VisitorFieldValidator(message = "Default message", key = "i18n.key", shortCircuit = true, context = "action alias", appendPrefix = true) ``` - -{% comment %}end snippet id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.VisitorFieldValidator {% endcomment %} -- To stop receiving notification emails like this one, please contact "commits@struts.apache.org" <commits@struts.apache.org>.