package org.argeo.slc.core.execution;
+import org.argeo.slc.SlcException;
public class PrimitiveSpecAttribute extends AbstractSpecAttribute implements
PrimitiveAccessor {
- // public enum Type {
- // string, integer
- // }
-
- public final static String TYPE_STRING = "string";
- public final static String TYPE_INTEGER = "integer";
- public final static String TYPE_LONG = "long";
- public final static String TYPE_FLOAT = "float";
- public final static String TYPE_DOUBLE = "double";
- public final static String TYPE_BOOLEAN = "boolean";
-
private String type = "string";
private Object value = null;
}
public void setType(String type) {
+ // check whether type is recognized.
+ if (PrimitiveUtils.typeAsClass(type) == null)
+ throw new SlcException("Unrecognized type " + type);
this.type = type;
- }
+ }
}