private void addAttributeValues(Env env, Element element, AnnotationMirror annotation, ExecutableElement member) throws IOException { CompilationController controller = env.getController(); TreeUtilities tu = controller.getTreeUtilities(); ElementUtilities eu = controller.getElementUtilities(); for (javax.annotation.processing.Completion completion : SourceUtils.getAttributeValueCompletions(controller, element, annotation, member, env.getPrefix())) { String value = completion.getValue().trim(); if (value.length() > 0 && startsWith(env, value)) { TypeMirror type = member.getReturnType(); TypeElement typeElement = null; while (type.getKind() == TypeKind.ARRAY) { type = ((ArrayType) type).getComponentType(); } if (type.getKind() == TypeKind.DECLARED) { CharSequence fqn = ((TypeElement) ((DeclaredType) type).asElement()).getQualifiedName(); if (JAVA_LANG_CLASS.contentEquals(fqn)) { String name = value.endsWith(".class") ? value.substring(0, value.length() - 6) : value; //NOI18N TypeMirror tm = tu.parseType(name, eu.outermostTypeElement(element)); typeElement = tm != null && tm.getKind() == TypeKind.DECLARED ? (TypeElement) ((DeclaredType) tm).asElement() : null; if (typeElement != null && startsWith(env, typeElement.getSimpleName().toString())) { env.addToExcludes(typeElement); } } } results.add(itemFactory.createAttributeValueItem(env.getController(), value, completion.getMessage(), typeElement, anchorOffset, env.getReferencesCount())); } } }