ResolvedNode resolved = context.resolve(argument); if (resolved != null) { for (ResolvedAnnotation annotation : resolved.getAnnotations()) { String signature = annotation.getSignature(); if (signature.equals(COLOR_INT_ANNOTATION)) {
/** * Searches for the annotation of the given type on this node * * @param type the fully qualified name of the annotation to check * @return the annotation, or null if not found */ @Nullable public ResolvedAnnotation getAnnotation(@NonNull String type) { for (ResolvedAnnotation annotation : getAnnotations()) { if (annotation.getType().matchesSignature(type)) { return annotation; } } return null; }