You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2026/04/09 10:57:14 UTC

(causeway-app-petclinic) 01/04: adds PetName meta-annotation

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

danhaywood pushed a commit to tag tags/3.6.0/04-01-pet-entity-key-properties
in repository https://gitbox.apache.org/repos/asf/causeway-app-petclinic.git

commit 1646d2082fa0700768628c715d55426f6d3326fb
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun May 26 11:34:10 2024 +0100

    adds PetName meta-annotation
---
 .../domainapp/modules/petowner/types/PetName.java  | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/module-petowner/src/main/java/domainapp/modules/petowner/types/PetName.java b/module-petowner/src/main/java/domainapp/modules/petowner/types/PetName.java
new file mode 100644
index 0000000..292a4b7
--- /dev/null
+++ b/module-petowner/src/main/java/domainapp/modules/petowner/types/PetName.java
@@ -0,0 +1,22 @@
+package domainapp.modules.petowner.types;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.causeway.applib.annotation.Optionality;
+import org.apache.causeway.applib.annotation.Parameter;
+import org.apache.causeway.applib.annotation.ParameterLayout;
+import org.apache.causeway.applib.annotation.Property;
+
+@Property(maxLength = PetName.MAX_LEN, optionality = Optionality.MANDATORY)
+@Parameter(maxLength = PetName.MAX_LEN, optionality = Optionality.MANDATORY)
+@ParameterLayout(named = "Name")
+@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface PetName {
+
+    int MAX_LEN = 60;
+
+}