use of dagger.Component in project tiger by google.
the class TigerDaggerGeneratorProcessor method getComponentDependencies.
/**
* Returns dependency components of the give component, empty set if none.
*/
private Set<TypeElement> getComponentDependencies(TypeElement component) {
Set<TypeElement> result = new HashSet<>();
AnnotationMirror componentAnnotationMirror = Preconditions.checkNotNull(Utils.getAnnotationMirror(component, Component.class), String.format("@Component not found for %s", component));
AnnotationValue dependenciesAnnotationValue = Utils.getAnnotationValue(componentAnnotationMirror, "dependencies");
if (dependenciesAnnotationValue == null) {
return result;
}
List<? extends AnnotationValue> dependencies = (List<? extends AnnotationValue>) dependenciesAnnotationValue.getValue();
for (AnnotationValue dependency : dependencies) {
result.add((TypeElement) ((DeclaredType) dependency.getValue()).asElement());
}
return result;
}
Aggregations