Package com.vaadin.ui

Class Dependency

  • All Implemented Interfaces:
    java.io.Serializable

    public class Dependency
    extends java.lang.Object
    implements java.io.Serializable
    Represents a stylesheet or JavaScript to include on the page.
    Since:
    8.0
    Author:
    Vaadin Ltd
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Dependency.Type
      The type of dependency.
    • Constructor Summary

      Constructors 
      Constructor Description
      Dependency​(Dependency.Type type, java.lang.String url)
      Creates a new dependency of the given type, to be loaded from the given URL.
    • Constructor Detail

      • Dependency

        public Dependency​(Dependency.Type type,
                          java.lang.String url)
        Creates a new dependency of the given type, to be loaded from the given URL.

        The URL is passed through the translation mechanism before loading, so custom protocols such as "vaadin://" can be used.

        Parameters:
        type - the type of dependency, not null
        url - the URL to load the dependency from, not null
    • Method Detail

      • getUrl

        public java.lang.String getUrl()
        Gets the untranslated URL for the dependency.
        Returns:
        the URL for the dependency
      • getType

        public Dependency.Type getType()
        Gets the type of the dependency.
        Returns:
        the type of the dependency
      • findDependencies

        public static java.util.List<Dependency> findDependencies​(java.util.List<java.lang.Class<? extends ClientConnector>> connectorTypes,
                                                                  LegacyCommunicationManager manager,
                                                                  DependencyFilter.FilterContext context)
        Finds all the URLs defined for the given classes, registers the URLs to the communication manager, passes the registered dependencies through any defined filters and returns the filtered collection of dependencies to load.
        Parameters:
        connectorTypes - the collection of connector classes to scan
        manager - a reference to the communication manager which tracks dependencies
        context - the context information for the filtering operation
        Returns:
        the list of found and filtered dependencies
        Since:
        8.1