You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2021/09/02 08:13:12 UTC

[isis] branch master updated: ISIS-2774: introduces new marker annots @ObjectSupport, @ObjectLifecycle

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 8d376cd  ISIS-2774: introduces new marker annots @ObjectSupport, @ObjectLifecycle
8d376cd is described below

commit 8d376cdbf4a3d2230970125f9aabc64cd84ce878
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Sep 2 10:12:36 2021 +0200

    ISIS-2774: introduces new marker annots @ObjectSupport, @ObjectLifecycle
    
    also updating cheat sheet
---
 .../resources/attachments/IsisCheatSheet.odt       | Bin 35366 -> 37389 bytes
 .../resources/attachments/IsisCheatSheet.pdf       | Bin 103507 -> 104641 bytes
 .../isis/applib/annotation/MemberSupport.java      |   9 ++++++---
 .../{MemberSupport.java => ObjectLifecycle.java}   |  17 ++++++++++-------
 .../{MemberSupport.java => ObjectSupport.java}     |  17 ++++++++++-------
 .../org/apache/isis/applib/annotation/Title.java   |   2 +-
 6 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/antora/components/docs/modules/resources/attachments/IsisCheatSheet.odt b/antora/components/docs/modules/resources/attachments/IsisCheatSheet.odt
index e6d7f6c..e23a444 100644
Binary files a/antora/components/docs/modules/resources/attachments/IsisCheatSheet.odt and b/antora/components/docs/modules/resources/attachments/IsisCheatSheet.odt differ
diff --git a/antora/components/docs/modules/resources/attachments/IsisCheatSheet.pdf b/antora/components/docs/modules/resources/attachments/IsisCheatSheet.pdf
index a86d94a..a8536e6 100644
Binary files a/antora/components/docs/modules/resources/attachments/IsisCheatSheet.pdf and b/antora/components/docs/modules/resources/attachments/IsisCheatSheet.pdf differ
diff --git a/api/applib/src/main/java/org/apache/isis/applib/annotation/MemberSupport.java b/api/applib/src/main/java/org/apache/isis/applib/annotation/MemberSupport.java
index 4346324..ed2f868 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/annotation/MemberSupport.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/annotation/MemberSupport.java
@@ -34,15 +34,18 @@ import java.lang.annotation.Target;
  * By placing the {@link MemberSupport} annotation on a method, a contract with the meta-model is enforced,
  * such that this method must be recognized by the meta-model and cannot be ignored.
  * <p>
- * In some sense acts as the semantic counterpart to {@link Programmatic}.
+ * It is complementary to {@link ObjectSupport} and {@link ObjectLifecycle},
+ * and in some sense acts as the semantic counterpart to {@link Programmatic}.
  *
  * @since 2.0 {@index}
+ * @see ObjectSupport
+ * @see ObjectLifecycle
  * @see Programmatic
  */
 @Inherited
-@Target({ ElementType.METHOD })
+@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Domain.Include // meta annotation, in support of meta-model validation
 public @interface MemberSupport {
 
-}
+}
\ No newline at end of file
diff --git a/api/applib/src/main/java/org/apache/isis/applib/annotation/MemberSupport.java b/api/applib/src/main/java/org/apache/isis/applib/annotation/ObjectLifecycle.java
similarity index 68%
copy from api/applib/src/main/java/org/apache/isis/applib/annotation/MemberSupport.java
copy to api/applib/src/main/java/org/apache/isis/applib/annotation/ObjectLifecycle.java
index 4346324..54b52c2 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/annotation/MemberSupport.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/annotation/ObjectLifecycle.java
@@ -26,23 +26,26 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
 /**
- * Indicates that a method is a supporting-method, one that contributes (hide, validate, ...)
- * to an <i>Action</i>, <i>Property</i> or <i>Collection</i>.
+ * Indicates that a method is a lifecycle callback method, one that contributes (disabled, hidden, ...)
+ * to its <i>Object</i>.
  * <p>
- * For <i>mixins</i> is also allowed to be placed on the mixin's main method.
+ * May only be placed on <i>domain object</i> methods, not <i>mixins</i> nor <i>domain services</i>.
  * <p>
- * By placing the {@link MemberSupport} annotation on a method, a contract with the meta-model is enforced,
+ * By placing the {@link ObjectLifecycle} annotation on a method, a contract with the meta-model is enforced,
  * such that this method must be recognized by the meta-model and cannot be ignored.
  * <p>
- * In some sense acts as the semantic counterpart to {@link Programmatic}.
+ * It is complementary to {@link MemberSupport} and {@link ObjectSupport},
+ * and in some sense acts as the semantic counterpart to {@link Programmatic}.
  *
  * @since 2.0 {@index}
+ * @see ObjectSupport
+ * @see MemberSupport
  * @see Programmatic
  */
 @Inherited
-@Target({ ElementType.METHOD })
+@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Domain.Include // meta annotation, in support of meta-model validation
-public @interface MemberSupport {
+public @interface ObjectLifecycle {
 
 }
diff --git a/api/applib/src/main/java/org/apache/isis/applib/annotation/MemberSupport.java b/api/applib/src/main/java/org/apache/isis/applib/annotation/ObjectSupport.java
similarity index 73%
copy from api/applib/src/main/java/org/apache/isis/applib/annotation/MemberSupport.java
copy to api/applib/src/main/java/org/apache/isis/applib/annotation/ObjectSupport.java
index 4346324..10d4365 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/annotation/MemberSupport.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/annotation/ObjectSupport.java
@@ -26,23 +26,26 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
 /**
- * Indicates that a method is a supporting-method, one that contributes (hide, validate, ...)
- * to an <i>Action</i>, <i>Property</i> or <i>Collection</i>.
+ * Indicates that a method is a supporting-method, one that contributes (disabled, hidden, ...)
+ * to its <i>Object</i>.
  * <p>
- * For <i>mixins</i> is also allowed to be placed on the mixin's main method.
+ * May only be placed on <i>domain object</i> methods, not <i>mixins</i> nor <i>domain services</i>.
  * <p>
- * By placing the {@link MemberSupport} annotation on a method, a contract with the meta-model is enforced,
+ * By placing the {@link ObjectSupport} annotation on a method, a contract with the meta-model is enforced,
  * such that this method must be recognized by the meta-model and cannot be ignored.
  * <p>
- * In some sense acts as the semantic counterpart to {@link Programmatic}.
+ * It is complementary to {@link MemberSupport} and {@link ObjectLifecycle},
+ * and in some sense acts as the semantic counterpart to {@link Programmatic}.
  *
  * @since 2.0 {@index}
+ * @see ObjectLifecycle
+ * @see MemberSupport
  * @see Programmatic
  */
 @Inherited
-@Target({ ElementType.METHOD })
+@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Domain.Include // meta annotation, in support of meta-model validation
-public @interface MemberSupport {
+public @interface ObjectSupport {
 
 }
diff --git a/api/applib/src/main/java/org/apache/isis/applib/annotation/Title.java b/api/applib/src/main/java/org/apache/isis/applib/annotation/Title.java
index d6f2e4b..ab8dadc 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/annotation/Title.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/annotation/Title.java
@@ -40,7 +40,7 @@ import java.lang.annotation.Target;
         ElementType.METHOD,
         ElementType.FIELD
 })
-@Domain.Include // meta annotation, in support of meta-model validation
+@ObjectSupport // meta annotation, in support of meta-model validation
 public @interface Title {
 
     /**