Search in sources :

Example 1 with Uses

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;
}
Also used : Uses(com.vaadin.flow.component.dependency.Uses)

Example 2 with Uses

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;
}
Also used : JsModule(com.vaadin.flow.component.dependency.JsModule) Uses(com.vaadin.flow.component.dependency.Uses)

Aggregations

Uses (com.vaadin.flow.component.dependency.Uses)2 JsModule (com.vaadin.flow.component.dependency.JsModule)1