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 2021/10/02 07:03:48 UTC

[isis-app-demo] 01/03: adds PhoneNumber meta-annotation

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

danhaywood pushed a commit to tag tags/03-08-add-remaining-PetOwner-properties
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git

commit 4e8600b22181dedfda7b20cfd001476956feee0b
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Oct 2 08:02:13 2021 +0100

    adds PhoneNumber meta-annotation
---
 .../petclinic/modules/pets/types/PhoneNumber.java  | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/module-pets/src/main/java/petclinic/modules/pets/types/PhoneNumber.java b/module-pets/src/main/java/petclinic/modules/pets/types/PhoneNumber.java
new file mode 100644
index 0000000..711fe6f
--- /dev/null
+++ b/module-pets/src/main/java/petclinic/modules/pets/types/PhoneNumber.java
@@ -0,0 +1,26 @@
+package petclinic.modules.pets.types;
+
+import java.lang.annotation.ElementType;
+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.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+
+@Property(
+        editing = Editing.ENABLED,
+        maxLength = PhoneNumber.MAX_LEN,
+        optionality = Optionality.OPTIONAL
+)
+@Parameter(maxLength = PhoneNumber.MAX_LEN, optionality = Optionality.OPTIONAL)
+@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface PhoneNumber {
+
+    int MAX_LEN = 30;
+}