]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/RefSpecAttribute.java
Add security
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / execution / RefSpecAttribute.java
index 61ac0871c12166058bd1c1c4c538261db331955d..e1c196016a1848de9b26a2dd0f62d3341e18a79a 100644 (file)
@@ -1,11 +1,16 @@
 package org.argeo.slc.core.execution;
 
-public class RefSpecAttribute extends AbstractSpecAttribute {
-       private Class targetClass;
+import java.util.List;
+
+public class RefSpecAttribute extends AbstractSpecAttribute implements
+               Cloneable {
+       private Class<?> targetClass;
        /** Read only. */
        private String targetClassName;
        private Object value = null;
 
+       private List<RefValueChoice> choices = null;
+
        public Object getValue() {
                return value;
        }
@@ -14,11 +19,11 @@ public class RefSpecAttribute extends AbstractSpecAttribute {
                this.value = value;
        }
 
-       public Class getTargetClass() {
+       public Class<?> getTargetClass() {
                return targetClass;
        }
 
-       public void setTargetClass(Class targetClass) {
+       public void setTargetClass(Class<?> targetClass) {
                this.targetClass = targetClass;
                this.targetClassName = targetClass.getName();
        }
@@ -27,4 +32,26 @@ public class RefSpecAttribute extends AbstractSpecAttribute {
                return targetClassName;
        }
 
+       /** @return can be null */
+       public List<RefValueChoice> getChoices() {
+               return choices;
+       }
+
+       public void setChoices(List<RefValueChoice> choices) {
+               this.choices = choices;
+       }
+
+       @Override
+       protected Object clone() throws CloneNotSupportedException {
+               RefSpecAttribute rsa = new RefSpecAttribute();
+               rsa.setTargetClass(targetClass);
+               rsa.setChoices(choices);
+               return rsa;
+       }
+
+       @Override
+       public String toString() {
+               return "Ref spec attribute [" + targetClass + "]";
+       }
+
 }