X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2FRefSpecAttribute.java;h=524979af2b8b87a584a49170d4d5d00f4cefbdef;hb=bfb5bb54702d2e706ab7a8b0bc4af94eada6e01c;hp=61ac0871c12166058bd1c1c4c538261db331955d;hpb=ee6c3543a0ff9403420ce6a9c647723269f14331;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/RefSpecAttribute.java b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/RefSpecAttribute.java index 61ac0871c..524979af2 100644 --- a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/RefSpecAttribute.java +++ b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/RefSpecAttribute.java @@ -1,11 +1,32 @@ +/* + * Copyright (C) 2010 Mathieu Baudier + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + 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 choices = null; + public Object getValue() { return value; } @@ -14,11 +35,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 +48,26 @@ public class RefSpecAttribute extends AbstractSpecAttribute { return targetClassName; } + /** @return can be null */ + public List getChoices() { + return choices; + } + + public void setChoices(List 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 + "]"; + } + }