private Object toScopeValue(Object value) {
            if (value instanceof TypeMirror) {
                return toTypeName((TypeMirror)value);
            } else if (value instanceof VariableElement) {
                return toEnumConstantName((VariableElement)value);
            } else if (value instanceof AnnotationMirror) {
                return toScope((AnnotationMirror)value);
            } else if (value instanceof List) {
                List<Object> result = new ArrayList<Object>();
                @SuppressWarnings("unchecked")
                List<? extends AnnotationValue> annotationValues = (List<? extends AnnotationValue>)value;
                for (AnnotationValue annotationValue: annotationValues) {
                    result.add(toScopeValue(annotationValue));
                }
                return result;
            } else if (value instanceof AnnotationValue) {
                AnnotationValue annotationValue = (AnnotationValue)value;
                return toScopeValue(annotationValue.getValue());
            } else {
                System.out.println(value.getClass().getName() + ": " + value);
                return value;
            }
        }