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/11/05 14:14:49 UTC

[isis] branch master updated: ISIS-2871: ValueSemantics annotation: add decimal number specific attributes

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 f010d41  ISIS-2871: ValueSemantics annotation: add decimal number specific attributes
f010d41 is described below

commit f010d414c30fffabcde51a5b80c95fb88d326a73
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Nov 5 15:13:31 2021 +0100

    ISIS-2871: ValueSemantics annotation: add decimal number specific
    attributes
---
 .../isis/applib/annotation/ValueSemantics.java     | 44 ++++++++++++++++++++--
 1 file changed, 40 insertions(+), 4 deletions(-)

diff --git a/api/applib/src/main/java/org/apache/isis/applib/annotation/ValueSemantics.java b/api/applib/src/main/java/org/apache/isis/applib/annotation/ValueSemantics.java
index 1dc60a0..bcfbca1 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/annotation/ValueSemantics.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/annotation/ValueSemantics.java
@@ -7,6 +7,8 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 import java.util.Locale;
 
+import javax.persistence.Column;
+
 import org.apache.isis.applib.adapters.ValueSemanticsProvider;
 
 /**
@@ -26,20 +28,54 @@ import org.apache.isis.applib.adapters.ValueSemanticsProvider;
         ElementType.METHOD,
         ElementType.FIELD,
         ElementType.TYPE,
-        ElementType.ANNOTATION_TYPE
+        ElementType.PARAMETER,
+        ElementType.ANNOTATION_TYPE,
 })
 @Retention(RetentionPolicy.RUNTIME)
 @Domain.Include // meta annotation, in support of meta-model validation
 public @interface ValueSemantics {
 
     /**
-     * <p>
      * Allows to select {@link ValueSemanticsProvider}(s) by qualifier.
      *
-     * @apiNote the selection (qualifier inclusion/exclusion) mechanics is not yet finalized,
-     * currently a single qualifier declared here must exactly match that of the targeted bean
+     * @apiNote the selection (qualifier inclusion/exclusion) mechanics could be improved,
+     * yet a single qualifier declared here must exactly match that of the targeted bean
      */
     String provider()
             default "";
 
+    /**
+     * minimum number of integral digits required for this number;
+     * default = {@code 1}
+     */
+    int minIntegralDigits()
+            default 1;
+
+    /**
+     * minimum number of fractional digits required for this number;
+     * default = {@code 0}
+     */
+    int minFractionalDigits()
+            default 0;
+
+    /**
+     * maximum number of total digits accepted for this number;<br>
+     * can be omitted, if {@link Column#precision()} is used<br>
+     * default = {@code 65}
+     * @apiNote SQL's DECIMAL(precision, scale) has max-precision=65 and max-scale=30
+     * @see Column#precision()
+     */
+    int maxTotalDigits()
+            default 65;
+
+    /**
+     * maximum number of fractional digits accepted for this number;<br>
+     * can be omitted, if {@link Column#scale()} is used<br>
+     * default = {@code 30}<br>
+     * @apiNote SQL's DECIMAL(precision, scale) has max-precision=65 and max-scale=30
+     * @see Column#scale()
+     */
+    int maxFractionalDigits()
+            default 30;
+
 }