You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/11/27 09:25:36 UTC
[4/5] isis git commit: ISIS-1241: updating documentation.
ISIS-1241: updating documentation.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/9c20aa92
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/9c20aa92
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/9c20aa92
Branch: refs/heads/master
Commit: 9c20aa9202ef753fe7b532caa2287704c5a26e21
Parents: f14944c
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Nov 27 08:21:35 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Nov 27 08:21:35 2015 +0000
----------------------------------------------------------------------
...annotations_manpage-Parameter_regexPattern.adoc | 14 ++++++++++----
..._annotations_manpage-Property_regexPattern.adoc | 17 ++++++++++++-----
2 files changed, 22 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/9c20aa92/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Parameter_regexPattern.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Parameter_regexPattern.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Parameter_regexPattern.adoc
index ecd7043..472a34c 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Parameter_regexPattern.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Parameter_regexPattern.adoc
@@ -6,10 +6,15 @@
+There are three attributes related to enforcing regular expressions:
-The `regexPattern()` attribute validates the contents of any string parameter with respect to a regular expression pattern. It is ignored if applied to parameters of any other type. This attribute can also be specified for xref:rg.adoc#_rg_annotations_manpage-Property_regexPattern[properties].
+* The `regexPattern()` attribute validates the contents of any string parameter with respect to a regular expression pattern. It is ignored if applied to parameters of any other type. This attribute can also be specified for xref:rg.adoc#_rg_annotations_manpage-Property_regexPattern[properties].
-The related `regexPatternFlags()` attribute specifies flags that modify the handling of the pattern. The values are those that would normally be passed to `java.util.regex.Pattern#compile(String,int)`.
+* The `regexPatternFlags()` attribute specifies flags that modify the handling of the pattern. The values are those
+that would normally be passed to `java.util.regex.Pattern#compile(String,int)`.
+
+* The related `regexPatternReplacement()` attribute (as of `1.11.0-SNAPSHOT`) specifies the error message to show if
+the provided argument does not match the regex pattern.
For example:
@@ -19,7 +24,8 @@ public class Customer {
public void updateEmail(
@Parameter(
regexPattern = "(\\w+\\.)*\\w+@(\\w+\\.)+[A-Za-z]+",
- regexPatternFlags=Pattern.CASE_INSENSITIVE
+ regexPatternFlags = Pattern.CASE_INSENSITIVE,
+ regexPatternReplacement = "Must be valid email address (containing a '@') symbol" // <1>
)
@ParameterLayout(named = "Email")
final String email) {
@@ -27,5 +33,5 @@ public class Customer {
}
)
----
+<1> unused prior to `1.11.0-SNAPSHOT`. Note that there is currently no i18n support for this phrase.
-The related `regexPatternReplacement()` attribute is currently unused.
http://git-wip-us.apache.org/repos/asf/isis/blob/9c20aa92/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Property_regexPattern.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Property_regexPattern.adoc b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Property_regexPattern.adoc
index a9cdb7b..5040910 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Property_regexPattern.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rg_annotations_manpage-Property_regexPattern.adoc
@@ -6,7 +6,15 @@
-The `regexPattern()` attribute validates the contents of any string property with respect to a regular expression pattern. It is ignored if applied to properties of any other type. This attribute can also be specified for xref:rg.adoc#_rg_annotations_manpage-Parameter_regexPattern[parameters].
+There are three attributes (as of `1.11.0-SNAPSHOT`, two in earlier releases) related to enforcing regular expressions:
+
+* The `regexPattern()` attribute validates the contents of any string property with respect to a regular expression pattern. It is ignored if applied to properties of any other type. This attribute can also be specified for xref:rg.adoc#_rg_annotations_manpage-Parameter_regexPattern[parameters].
+
+* The `regexPatternFlags()` attribute specifies flags that modify the handling of the pattern. The values are those
+that would normally be passed to `java.util.regex.Pattern#compile(String,int)`.
+
+* The related `regexPatternReplacement()` attribute (as of `1.11.0-SNAPSHOT`) specifies the error message to show if
+the provided argument does not match the regex pattern.
For example:
@@ -15,14 +23,13 @@ For example:
public class Customer {
@Property(
regexPattern = "(\\w+\\.)*\\w+@(\\w+\\.)+[A-Za-z]+",
- regexPatternFlags=Pattern.CASE_INSENSITIVE
+ regexPatternFlags=Pattern.CASE_INSENSITIVE,
+ regexPatternReplacement = "Must be valid email address (containing a '@') symbol" // <1>
)
public String getEmail() { ... }
}
----
+<1> new in `1.11.0-SNAPSHOT`. Note that there is currently no i18n support for this phrase.
-The related `regexPatternFlags()` attribute specifies flags that modify the handling of the pattern. The values are those that would normally be passed to `java.util.regex.Pattern#compile(String,int)`.
-
-