use of com.vaadin.flow.component.dependency.Uses in project flow by vaadin.
the class ComponentMetaData method findDependencies.
private static DependencyInfo findDependencies(Class<? extends Component> componentClass, DependencyInfo dependencyInfo, Set<Class<? extends Component>> scannedClasses) {
assert !scannedClasses.contains(componentClass);
scannedClasses.add(componentClass);
dependencyInfo.htmlImports.addAll(getHtmlImportDependencies(componentClass));
dependencyInfo.javaScripts.addAll(AnnotationReader.getJavaScriptAnnotations(componentClass));
dependencyInfo.styleSheets.addAll(AnnotationReader.getStyleSheetAnnotations(componentClass));
List<Uses> usesList = AnnotationReader.getAnnotationsFor(componentClass, Uses.class);
for (Uses uses : usesList) {
Class<? extends Component> otherClass = uses.value();
if (!scannedClasses.contains(otherClass)) {
findDependencies(otherClass, dependencyInfo, scannedClasses);
}
}
return dependencyInfo;
}
use of com.vaadin.flow.component.dependency.Uses in project flow by vaadin.
the class ComponentMetaData method findDependencies.
private static DependencyInfo findDependencies(VaadinService service, Class<? extends Component> componentClass, DependencyInfo dependencyInfo, Set<Class<? extends Component>> scannedClasses) {
assert !scannedClasses.contains(componentClass);
scannedClasses.add(componentClass);
List<JsModule> jsModules = AnnotationReader.getJsModuleAnnotations(componentClass);
dependencyInfo.jsModules.addAll(jsModules);
dependencyInfo.javaScripts.addAll(AnnotationReader.getJavaScriptAnnotations(componentClass));
dependencyInfo.styleSheets.addAll(AnnotationReader.getStyleSheetAnnotations(componentClass));
dependencyInfo.cssImports.addAll(AnnotationReader.getCssImportAnnotations(componentClass));
List<Uses> usesList = AnnotationReader.getAnnotationsFor(componentClass, Uses.class);
for (Uses uses : usesList) {
Class<? extends Component> otherClass = uses.value();
if (!scannedClasses.contains(otherClass)) {
findDependencies(service, otherClass, dependencyInfo, scannedClasses);
}
}
return dependencyInfo;
}