public static TypeMirror getAnnotationValueAsTypeMirror(AnnotationMirror mirror, String method) {
        for (Map.Entry<? extends ExecutableElement,? extends AnnotationValue> entry : mirror.getElementValues().entrySet()) {
            if (entry.getKey().getSimpleName().toString().equals(method)) {
                return (TypeMirror) entry.getValue().getValue();
            }
        }
        return null;
    }
Various utility classes for {@link Element} and {@link AnnotationMirror} handling

@author tiwe
querydsl-apt/src/main/java/com/querydsl/apt/TypeUtils.java