org.apache.tapestry5.annotations

## Annotation Type Import

-     @Target(value={TYPE,METHOD})
       @Retention(value=RUNTIME)
       @Documented
       @UseWith(value={COMPONENT,MIXIN,PAGE})
      public @interface Import

  Annotations to control the importing of JavaScript stacks and libraries as well as stylesheets. This annotation may be placed on a class, in which case importing will occur as part of the `SetupRender` render phase. Alternately, the annotation maybe placed on any method (though typically it will be placed on a render phase method) and the import operations will be associated of that method. Use of this annotation is translated into invocations against the `JavaScriptSupport` environmental; all imports there will implicitly import the core stack. Assets are localized during the `PageLifecycleAdapter.containingPageDidLoad()` lifecycle method.
  Since:
    5.2.0

- - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `String[]` | `library` JavaScript libraries to import.
    `String[]` | `module` Names of modules to import.
    `String[]` | `stack` JavaScript Stacks to import.
    `String[]` | `stylesheet` Stylesheets to import.

- - ### Element Detail

    - #### stack

          public abstract String[] stack

      JavaScript Stacks to import. Stacks are imported before individual libraries. Note that stacks themselves may have dependencies on other stacks.
      See Also:
        `JavaScriptStack`, `JavaScriptSupport.importStack(String)`
      Default:
        {}

  - - #### library

          public abstract String[] library

      JavaScript libraries to import. Each value is an asset path; symbols in each path are expanded. The library may be localized.
      See Also:
        `JavaScriptSupport.importJavaScriptLibrary(org.apache.tapestry5.Asset)`
      Default:
        {}

  - - #### stylesheet

          public abstract String[] stylesheet

      Stylesheets to import. Each value is an asset path; symbols in each path are expanded. The stylesheet may be localized. The stylesheet is imported with no options.
      See Also:
        `JavaScriptSupport.importStylesheet(org.apache.tapestry5.Asset)`
      Default:
        {}

  - - #### module

          public abstract String[] module

      Names of modules to import. A module name consists of a path, with the terms seperated by a slash character. The first term is the library name (or "app" for the application), e.g. `flash/gordon` would map to the file `META-INF/modules/flash/gordon.js`. Alternately a function name can be included, after a colon seperator. e.g., `flash/gordon:setup`. Module initializations specified this way may not have an parameters, so they are typically doing single-use setup.
      Since:
        5.4
      See Also:
        `ModuleManager`, `JavaScriptSupport.require(String)`
      Default:
        {}

5.6.0 - Copyright © 2003-2020 The Apache Software Foundation.