class SpecificationReader {

	protected Object toAttribute(nu.xom.Element eAttribute)
			throws IllegalArgumentException, SecurityException, InstantiationException, IllegalAccessException,
			InvocationTargetException, NoSuchMethodException, ClassNotFoundException {
		String parameter = eAttribute.getAttributeValue("parameter");
		String type = eAttribute.getAttributeValue("type");
		String value = eAttribute.getValue();

		if (type == null) {
			throw new IllegalArgumentException("no type given for attribute " + eAttribute);
		}
		if (parameter != null) {

			if (parameter.equals("RANGE")) {
				return getRange(value);
			} else if (parameter.equals("DISCRETERANGE")) {
				return getRangeInt(value);
			} else if (parameter.equals("SELECT")) {
				return getSelectRefList(type, value);
			} else if (parameter.equals("UID")) {
				return getUniqueID(value);
			} else {
				throw new IllegalArgumentException("Unknown parameter type: " + parameter);
			}
		} else {
			Class<?> clazz = null;
			try {
				clazz = getClass(type);
			} catch (ClassNotFoundException e) {
				System.err.println("Class " + type + " not found. Ignoring attribute value " + value);
				return null;
			}
			if (Collection.class.isAssignableFrom(clazz)) {
				return toAttributeCollection(eAttribute, clazz);
			} else {
				return toAttributeObject(value, clazz);
			}
		}
	}

}