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 2020/07/22 07:55:46 UTC

[isis] 01/02: ISIS-2222: adds @Property(editing=...)

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 54405e5c3067a5c34b2eaffb4f3ab6b16f84d598
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jul 22 08:21:30 2020 +0100

    ISIS-2222: adds @Property(editing=...)
    
    Also fixes up descriptions of some of the other @Property's
---
 .../dom/annotDomain/Property/PropertyMenu.java     | 20 +++++---
 .../dom/annotDomain/Property/editing/.gitkeep      |  0
 .../editing/EditingEnabledMetaAnnotation.java      | 24 +++++++++
 .../editing/PropertyEditingVm-description.adoc     | 58 ++++++++++++++++++++++
 .../PropertyEditingVm.java}                        | 32 ++++++------
 .../Property/editing/PropertyEditingVm.layout.xml  | 43 ++++++++++++++++
 .../Property/fileAccept/PropertyFileAcceptVm.java  | 16 +++---
 .../Property/maxLength/PropertyMaxLengthVm.java    |  5 +-
 ...opertyMaxLengthVm_updateWithMetaAnnotation.java |  2 +-
 ...engthVm_updateWithMetaAnnotationOverridden.java |  2 +-
 .../mustSatisfy/PropertyMustSatisfyVm.java         | 14 ++----
 ...tisfyVm_updateWithMetaAnnotationOverridden.java |  4 +-
 .../PropertyRegexPatternVm-description.adoc        |  2 +-
 .../regexPattern/PropertyRegexPatternVm.java       | 22 ++++----
 ...rtyRegexPatternVm_updateWithMetaAnnotation.java |  4 +-
 ...tternVm_updateWithMetaAnnotationOverridden.java | 11 ++--
 ...ava => RegexPatternEmailComMetaAnnotation.java} |  2 +-
 17 files changed, 195 insertions(+), 66 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java
index 5b7bbfc..bef9350 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java
@@ -33,6 +33,7 @@ import org.apache.isis.applib.value.Clob;
 import lombok.val;
 import lombok.extern.log4j.Log4j2;
 
+import demoapp.dom.annotDomain.Property.editing.PropertyEditingVm;
 import demoapp.dom.annotDomain.Property.fileAccept.PropertyFileAcceptVm;
 import demoapp.dom.annotDomain.Property.maxLength.PropertyMaxLengthVm;
 import demoapp.dom.annotDomain.Property.mustSatisfy.PropertyMustSatisfyVm;
@@ -44,6 +45,17 @@ import demoapp.dom.types.Samples;
 public class PropertyMenu {
 
     @Action(semantics = SemanticsOf.SAFE)
+    @ActionLayout(cssClassFa="fa-pencil-alt", describedAs = "Editable fields")
+    public PropertyEditingVm editing(){
+        val vm = new PropertyEditingVm();
+
+        vm.setPropertyUsingAnnotation("this property is editable");
+        vm.setPropertyUsingMetaAnnotation("this property is also editable");
+        vm.setPropertyUsingMetaAnnotationButOverridden("this property is NOT editable");
+        return vm;
+    }
+
+    @Action(semantics = SemanticsOf.SAFE)
     @ActionLayout(cssClassFa="fa-file-upload", describedAs = "Length of text fields")
     public PropertyFileAcceptVm fileAccept(){
         val vm = new PropertyFileAcceptVm();
@@ -88,18 +100,14 @@ public class PropertyMenu {
 
     private void setSampleBlob(String suffix, Consumer<Blob> blobConsumer) {
         blobSamples.stream()
-                .filter(x -> {
-                    return x.getName().endsWith(suffix);
-                })
+                .filter(x -> x.getName().endsWith(suffix))
                 .findFirst()
                 .ifPresent(blobConsumer);
     }
 
     private void setSampleClob(String suffix, Consumer<Clob> clobConsumer) {
         clobSamples.stream()
-                .filter(x -> {
-                    return x.getName().endsWith(suffix);
-                })
+                .filter(x -> x.getName().endsWith(suffix))
                 .findFirst()
                 .ifPresent(clobConsumer);
     }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/.gitkeep b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/EditingEnabledMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/EditingEnabledMetaAnnotation.java
new file mode 100644
index 0000000..c9a91c7
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/EditingEnabledMetaAnnotation.java
@@ -0,0 +1,24 @@
+package demoapp.dom.annotDomain.Property.editing;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.Property;
+
+//tag::class[]
+@Property(editing = Editing.ENABLED)                // <.>
+@Inherited
+@Target({
+        ElementType.METHOD, ElementType.FIELD,      // <.>
+        ElementType.TYPE                            // <.>
+})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface EditingEnabledMetaAnnotation {
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm-description.adoc
new file mode 100644
index 0000000..8f4dd1e
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm-description.adoc
@@ -0,0 +1,58 @@
+The "editing" semantic specifies that a property's value can be changed through the UI:
+
+* for properties, the semantic can be specified using either the `@Property` annotation, or a meta-annotation
+
+There is no corresponding semantic for parameters, parameters are implicitly editable.
+
+
+== Annotated
+
+The editing semantic can be specified explicitly using an annotation:
+
+* for properties, using `@Property#editing()`:
++
+[source,java,indent=0]
+----
+include::PropertyEditingVm.java[tags=annotation]
+----
+<.> explicitly specifies the maximum length that can be entered for the property
+
+The annotation could also be applied to a mixin, but would have little effect because mixin properties are always read-only.
+
+== Meta-annotated
+
+The editing semantic can also be specified using a custom meta-annotation:
+
+* the meta-annotation is defined as:
++
+[source,java]
+----
+include::EditingEnabledMetaAnnotation.java[tags=class]
+----
+<.> annotated for property ...
+<.> annotation can be applied to a property (either its getter or the field directly)
+<.> annotation can be applied to a type (ie, meta-meta annotations recursively)
+
+* and can be applied to a property:
++
+[source,java,indent=0]
+----
+include::PropertyEditingVm.java[tags=meta-annotated]
+----
+<.> semantic is inherited from the meta-annotation
+
+
+
+=== Meta-annotated Overridden
+
+The meta-annotation can itself be overridden:
+
+* in a property:
++
+[source,java,indent=0]
+----
+include::PropertyEditingVm.java[tags=meta-annotated-overridden]
+----
+<.> semantic from meta-annotation ...
+<.> \... is overridden by the `@Property` annotation
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm.java
similarity index 76%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm.java
index e1e4f9a..5f2523e 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package demoapp.dom.annotDomain.Property.maxLength;
+package demoapp.dom.annotDomain.Property.editing;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -43,23 +43,24 @@ import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
 @XmlAccessorType(XmlAccessType.FIELD)
 @DomainObject(
         nature=Nature.VIEW_MODEL,
-        objectType = "demo.PropertyLayoutMaxLengthVm",
-        editing = Editing.ENABLED
+        objectType = "demo.PropertyLayoutEditingVm",
+        editing = Editing.DISABLED                              // <.>
 )
-public class PropertyMaxLengthVm implements HasAsciiDocDescription {
+public class PropertyEditingVm implements HasAsciiDocDescription {
+    // ...
+//end::class[]
 
     public String title() {
-        return "PropertyLayout#maxLength";
+        return "PropertyLayout#editing";
     }
 
 //tag::annotation[]
     @Property(
-        maxLength = 10                                  // <.>
-        , optionality = Optionality.OPTIONAL
+        editing = Editing.ENABLED                               // <.>
     )
     @PropertyLayout(
         describedAs =
-            "@Property(maxLength = 10)"
+            "@Property(editing = DISABLED)"
     )
     @MemberOrder(name = "annotation", sequence = "1")
     @XmlElement(required = false)
@@ -69,9 +70,9 @@ public class PropertyMaxLengthVm implements HasAsciiDocDescription {
 
 //tag::meta-annotated[]
     @Property(optionality = Optionality.OPTIONAL)
-    @MaxLength10MetaAnnotation                            // <.>
+    @EditingEnabledMetaAnnotation                            // <.>
     @PropertyLayout(
-        describedAs = "@MaxLength10MetaAnnotation"
+        describedAs = "@EditingEnabledMetaAnnotation"
     )
     @MemberOrder(name = "meta-annotated", sequence = "1")
     @XmlElement(required = false)
@@ -81,13 +82,13 @@ public class PropertyMaxLengthVm implements HasAsciiDocDescription {
 
 //tag::meta-annotated-overridden[]
     @Property(
-        maxLength = 3                                   // <.>
-        , optionality = Optionality.OPTIONAL)
-    @MaxLength10MetaAnnotation                            // <.>
+        editing = Editing.DISABLED                          // <.>
+    )
+    @EditingEnabledMetaAnnotation                            // <.>
     @PropertyLayout(
         describedAs =
-            "@MaxLength10MetaAnnotation " +
-            "@PropertyLayout(maxLength = 3)"
+            "@EditingEnabledMetaAnnotation " +
+            "@PropertyLayout(editing = DISABLED)"
     )
     @MemberOrder(name = "meta-annotated-overridden", sequence = "1")
     @XmlElement(required = false)
@@ -95,5 +96,6 @@ public class PropertyMaxLengthVm implements HasAsciiDocDescription {
     private String propertyUsingMetaAnnotationButOverridden;
 //end::meta-annotated-overridden[]
 
+//tag::class[]
 }
 //end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm.layout.xml
new file mode 100644
index 0000000..7bee342
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm.layout.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<bs3:grid
+        xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd   http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+        xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3"
+        xmlns:cpt="http://isis.apache.org/applib/layout/component"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+	<bs3:row>
+		<bs3:col span="10" unreferencedActions="true">
+			<cpt:domainObject />
+			<cpt:action id="rebuildMetamodel"/>
+		</bs3:col>
+		<bs3:col span="2">
+			<cpt:fieldSet name="" id="sources" />
+		</bs3:col>
+	</bs3:row>
+
+	<bs3:row>
+		<bs3:col span="6">
+			<cpt:fieldSet name="Annotated" id="annotation"/>
+			<cpt:fieldSet name="Contributed" id="contributed"/>
+			<cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+			<cpt:fieldSet name="Meta-annotated Overridden" id="meta-annotated-overridden"/>
+			<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+		</bs3:col>
+		<bs3:col span="6">
+			<cpt:fieldSet name="Description" id="description" >
+				<cpt:action id="clearHints" position="PANEL" />
+				<cpt:action id="downloadLayoutXml"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="rebuildMetamodel" position="PANEL_DROPDOWN"/>
+				<cpt:action id="downloadMetamodelXml"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="inspectMetamodel"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="downloadJdoMetadata"  position="PANEL_DROPDOWN"/>
+				<cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+				<cpt:property id="description"/>
+			</cpt:fieldSet>
+		</bs3:col>
+	</bs3:row>
+	<bs3:row>
+		<bs3:col span="12" unreferencedCollections="true"/>
+	</bs3:row>
+
+</bs3:grid>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/fileAccept/PropertyFileAcceptVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/fileAccept/PropertyFileAcceptVm.java
index cb837cd..ecefdaf 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/fileAccept/PropertyFileAcceptVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/fileAccept/PropertyFileAcceptVm.java
@@ -52,20 +52,19 @@ import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
 public class PropertyFileAcceptVm implements HasAsciiDocDescription {
 
     public String title() {
-        return "PropertyLayout#maxLength";
+        return "PropertyLayout#fileAccept";
     }
 
 //tag::annotation[]
     @Property(
         fileAccept = ".pdf"                                 // <.>
-        , optionality = Optionality.OPTIONAL
     )
     @PropertyLayout(
         describedAs =
             "@Property(fileAccept = \".pdf\")"
     )
     @MemberOrder(name = "annotation", sequence = "1")
-    @XmlElement(required = false)
+    @XmlElement(required = true)
     @Getter @Setter
     private Blob pdfPropertyUsingAnnotation;
 //end::annotation[]
@@ -73,26 +72,25 @@ public class PropertyFileAcceptVm implements HasAsciiDocDescription {
 //tag::annotation-clob[]
     @Property(
         fileAccept = ".txt"                     // <.>
-        , optionality = Optionality.OPTIONAL
     )
     @PropertyLayout(
         describedAs =
             "@Property(fileAccept = \".txt\")"
     )
     @MemberOrder(name = "annotation", sequence = "1")
-    @XmlElement(required = false)
+    @XmlElement(required = true)
     @Getter @Setter
     private Clob txtPropertyUsingAnnotation;
 //end::annotation-clob[]
 
 //tag::meta-annotated[]
-    @Property(optionality = Optionality.OPTIONAL)
+    @Property()
     @FileAcceptPdfMetaAnnotation                            // <.>
     @PropertyLayout(
         describedAs = "@FileAcceptPdfMetaAnnotation"
     )
     @MemberOrder(name = "meta-annotated", sequence = "1")
-    @XmlElement(required = false)
+    @XmlElement(required = true)
     @Getter @Setter
     private Blob pdfPropertyUsingMetaAnnotation;
 //end::meta-annotated[]
@@ -100,14 +98,14 @@ public class PropertyFileAcceptVm implements HasAsciiDocDescription {
 //tag::meta-annotated-overridden[]
     @Property(
         fileAccept = ".docx"                                // <.>
-        , optionality = Optionality.OPTIONAL)
+    )
     @FileAcceptPdfMetaAnnotation                            // <.>
     @PropertyLayout(
         describedAs =
             "@FileAcceptPdfMetaAnnotation @PropertyLayout(...)"
     )
     @MemberOrder(name = "meta-annotated-overridden", sequence = "1")
-    @XmlElement(required = false)
+    @XmlElement(required = true)
     @Getter @Setter
     private Blob docxPropertyUsingMetaAnnotationButOverridden;
 //end::meta-annotated-overridden[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm.java
index e1e4f9a..82281d9 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm.java
@@ -55,14 +55,13 @@ public class PropertyMaxLengthVm implements HasAsciiDocDescription {
 //tag::annotation[]
     @Property(
         maxLength = 10                                  // <.>
-        , optionality = Optionality.OPTIONAL
     )
     @PropertyLayout(
         describedAs =
             "@Property(maxLength = 10)"
     )
     @MemberOrder(name = "annotation", sequence = "1")
-    @XmlElement(required = false)
+    @XmlElement(required = true)
     @Getter @Setter
     private String propertyUsingAnnotation;
 //end::annotation[]
@@ -80,10 +79,10 @@ public class PropertyMaxLengthVm implements HasAsciiDocDescription {
 //end::meta-annotated[]
 
 //tag::meta-annotated-overridden[]
+    @MaxLength10MetaAnnotation                          // <.>
     @Property(
         maxLength = 3                                   // <.>
         , optionality = Optionality.OPTIONAL)
-    @MaxLength10MetaAnnotation                            // <.>
     @PropertyLayout(
         describedAs =
             "@MaxLength10MetaAnnotation " +
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm_updateWithMetaAnnotation.java
index 01f6841..18e0989 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm_updateWithMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm_updateWithMetaAnnotation.java
@@ -37,8 +37,8 @@ public class PropertyMaxLengthVm_updateWithMetaAnnotation {
 
 //tag::meta-annotation[]
     public PropertyMaxLengthVm act(
-            @Parameter(optionality = Optionality.OPTIONAL)
             @MaxLength10MetaAnnotation                            // <.>
+            @Parameter(optionality = Optionality.OPTIONAL)
             @ParameterLayout(
                 describedAs = "@MaxLength10MetaAnnotation"
             )
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm_updateWithMetaAnnotationOverridden.java
index 6018e6d..5b52040 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm_updateWithMetaAnnotationOverridden.java
@@ -19,11 +19,11 @@ public class PropertyMaxLengthVm_updateWithMetaAnnotationOverridden {
 
 //tag::meta-annotation-overridden[]
     public PropertyMaxLengthVm act(
+            @MaxLength10MetaAnnotation                          // <.>
             @Parameter(
                 maxLength = 3                                   // <.>
                 , optionality = Optionality.OPTIONAL
             )
-            @MaxLength10MetaAnnotation                            // <.>
             @ParameterLayout(
                 describedAs =
                     "@MaxLength10MetaAnnotation " +
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/PropertyMustSatisfyVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/PropertyMustSatisfyVm.java
index 86707fa..2bae0e1 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/PropertyMustSatisfyVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/PropertyMustSatisfyVm.java
@@ -56,45 +56,41 @@ public class PropertyMustSatisfyVm implements HasAsciiDocDescription {
 //tag::annotation[]
     @Property(
         mustSatisfy = OfWorkingAgeSpecification.class       // <.>
-        , optionality = Optionality.OPTIONAL
     )
     @PropertyLayout(
         describedAs =
             "mustSatisfy = OfWorkingAgeSpecification.class"
     )
     @MemberOrder(name = "annotation", sequence = "1")
-    @XmlElement(required = false)
+    @XmlElement(required = true)
     @Getter @Setter
     private Integer customerAgePropertyUsingAnnotation;
 //end::annotation[]
 
 //tag::meta-annotated[]
-    @Property(
-            optionality = Optionality.OPTIONAL
-    )
+    @Property()
     @MustSatisfyOfWorkingAgeMetaAnnotation                     // <.>
     @PropertyLayout(
         describedAs = "@MustSatisfyOfWorkingAgeMetaAnnotation"
     )
     @MemberOrder(name = "meta-annotated", sequence = "1")
-    @XmlElement(required = false)
+    @XmlElement(required = true)
     @Getter @Setter
     private Integer customerAgePropertyUsingMetaAnnotation;
 //end::meta-annotated[]
 
 //tag::meta-annotated-overridden[]
+    @MustSatisfyOfWorkingAgeMetaAnnotation                     // <.>
     @Property(
         mustSatisfy = OfRetirementAgeSpecification.class       // <.>
-        , optionality = Optionality.OPTIONAL
     )
-    @MustSatisfyOfWorkingAgeMetaAnnotation                     // <.>
     @PropertyLayout(
         describedAs =
             "@MustSatisfyOfWorkingAgeMetaAnnotation " +
             "@PropertyLayout(mustSatisfy = OfRetirementAgeSpecification.class)"
     )
     @MemberOrder(name = "meta-annotated-overridden", sequence = "1")
-    @XmlElement(required = false)
+    @XmlElement(required = true)
     @Getter @Setter
     private Integer customerAgePropertyUsingMetaAnnotationButOverridden;
 //end::meta-annotated-overridden[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/PropertyMustSatisfyVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/PropertyMustSatisfyVm_updateWithMetaAnnotationOverridden.java
index 4a9e9ff..f324c2a 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/PropertyMustSatisfyVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/PropertyMustSatisfyVm_updateWithMetaAnnotationOverridden.java
@@ -22,10 +22,10 @@ public class PropertyMustSatisfyVm_updateWithMetaAnnotationOverridden {
 
 //tag::meta-annotation-overridden[]
     public PropertyMustSatisfyVm act(
+            @MustSatisfyOfWorkingAgeMetaAnnotation                  // <.>
             @Parameter(
-                mustSatisfy = OfRetirementAgeSpecification.class            // <.>
+                mustSatisfy = OfRetirementAgeSpecification.class    // <.>
             )
-            @MustSatisfyOfWorkingAgeMetaAnnotation                         // <.>
             @ParameterLayout(
                 describedAs =
                     "@MustSatisfyOfWorkingAgeMetaAnnotation " +
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm-description.adoc
index 1ef7a46..406a520 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm-description.adoc
@@ -36,7 +36,7 @@ The regexPattern semantic can also be specified using a custom meta-annotation:
 +
 [source,java]
 ----
-include::RegexPatternMetaAnnotation.java[tags=class]
+include::RegexPatternEmailComMetaAnnotation.java[tags=class]
 ----
 <.> annotated for property ...
 <.> \... and also for parameter.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm.java
index 79bc5f8..7d0df93 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm.java
@@ -59,23 +59,22 @@ public class PropertyRegexPatternVm implements HasAsciiDocDescription {
         regexPattern = "^\\w+@\\w+[.]com$"                          // <.>
         , regexPatternReplacement = "Must be .com email address"    // <.>
         , regexPatternFlags = Pattern.CASE_INSENSITIVE              // <.>
-        , optionality = Optionality.OPTIONAL
     )
     @PropertyLayout(
         describedAs =
-            "regexPattern = \"^\\w+@\\w+[.]com$\"\""
+            "@Property(regexPattern = \"^\\w+@\\w+[.]com$\"\")"
     )
     @MemberOrder(name = "annotation", sequence = "1")
-    @XmlElement(required = false)
+    @XmlElement(required = true)
     @Getter @Setter
     private String emailAddressPropertyUsingAnnotation;
 //end::annotation[]
 
 //tag::meta-annotated[]
     @Property(optionality = Optionality.OPTIONAL)
-    @RegexPatternMetaAnnotation                             // <.>
+    @RegexPatternEmailComMetaAnnotation                             // <.>
     @PropertyLayout(
-        describedAs = "@RegexPatternMetaAnnotation"
+        describedAs = "@RegexPatternEmailComMetaAnnotation"
     )
     @MemberOrder(name = "meta-annotated", sequence = "1")
     @XmlElement(required = false)
@@ -84,18 +83,19 @@ public class PropertyRegexPatternVm implements HasAsciiDocDescription {
 //end::meta-annotated[]
 
 //tag::meta-annotated-overridden[]
+    @RegexPatternEmailComMetaAnnotation                             // <.>
     @Property(
         regexPattern = "^\\w+@\\w+[.]org$"                          // <.>
-        , regexPatternReplacement = "Must be .org email address"    // <.>
-        , regexPatternFlags = Pattern.COMMENTS                      // <.>
-        , optionality = Optionality.OPTIONAL)
-    @RegexPatternMetaAnnotation                                     // <.>
+        , regexPatternReplacement = "Must be .org email address"
+        , regexPatternFlags = Pattern.COMMENTS
+    )
     @PropertyLayout(
         describedAs =
-            "@RegexPatternMetaAnnotation @PropertyLayout(...)"
+            "@RegexPatternEmailComMetaAnnotation " +
+            "@Property(regexPattern = \"^\\w+@\\w+[.]org$\"\")"
     )
     @MemberOrder(name = "meta-annotated-overridden", sequence = "1")
-    @XmlElement(required = false)
+    @XmlElement(required = true)
     @Getter @Setter
     private String emailAddressPropertyUsingMetaAnnotationButOverridden;
 //end::meta-annotated-overridden[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm_updateWithMetaAnnotation.java
index 58ceac6..0171cbf 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm_updateWithMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm_updateWithMetaAnnotation.java
@@ -38,9 +38,9 @@ public class PropertyRegexPatternVm_updateWithMetaAnnotation {
 //tag::meta-annotation[]
     public PropertyRegexPatternVm act(
             @Parameter(optionality = Optionality.OPTIONAL)
-            @RegexPatternMetaAnnotation                            // <.>
+            @RegexPatternEmailComMetaAnnotation                            // <.>
             @ParameterLayout(
-                describedAs = "@RegexPatternMetaAnnotation"
+                describedAs = "@RegexPatternEmailComMetaAnnotation"
             )
             final String emailAddressParameterUsingMetaAnnotation) {
         propertyRegexPatternVm.setEmailAddressPropertyUsingMetaAnnotation(emailAddressParameterUsingMetaAnnotation);
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm_updateWithMetaAnnotationOverridden.java
index a31ca96..182f0be 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm_updateWithMetaAnnotationOverridden.java
@@ -21,16 +21,17 @@ public class PropertyRegexPatternVm_updateWithMetaAnnotationOverridden {
 
 //tag::meta-annotation-overridden[]
     public PropertyRegexPatternVm act(
+            @RegexPatternEmailComMetaAnnotation                             // <.>
             @Parameter(
-                regexPattern = "^[^@+]@[^\\.+]\\.org$"          // <.>
-                , regexPatternReplacement = "Must be .org email address"    // <.>
-                , regexPatternFlags = Pattern.COMMENTS                      // <.>
+                regexPattern = "^[^@+]@[^\\.+]\\.org$"                      // <.>
+                , regexPatternReplacement = "Must be .org email address"
+                , regexPatternFlags = Pattern.COMMENTS
                 , optionality = Optionality.OPTIONAL
             )
-            @RegexPatternMetaAnnotation                         // <.>
             @ParameterLayout(
                 describedAs =
-                    "@RegexPatternMetaAnnotation @ParameterLayout(...)"
+                    "@RegexPatternEmailComMetaAnnotation " +
+                    "@Parameter(regexPattern = \"^\\w+@\\w+[.]org$\"\")"
             )
             final String emailAddressParameterUsingMetaAnnotationButOverridden) {
         propertyRegexPatternVm.setEmailAddressPropertyUsingMetaAnnotationButOverridden(emailAddressParameterUsingMetaAnnotationButOverridden);
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/RegexPatternMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/RegexPatternEmailComMetaAnnotation.java
similarity index 95%
rename from examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/RegexPatternMetaAnnotation.java
rename to examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/RegexPatternEmailComMetaAnnotation.java
index 7bedaa4..454f6eb 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/RegexPatternMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/RegexPatternEmailComMetaAnnotation.java
@@ -28,7 +28,7 @@ import org.apache.isis.applib.annotation.Property;
     ElementType.TYPE                                            // <.>
 })
 @Retention(RetentionPolicy.RUNTIME)
-public @interface RegexPatternMetaAnnotation {
+public @interface RegexPatternEmailComMetaAnnotation {
 
 }
 //end::class[]