Package org.apache.tapestry5.services.javascript

## Enum StackExtensionType

- java.lang.Object
- - java.lang.Enum<StackExtensionType>
  - - org.apache.tapestry5.services.javascript.StackExtensionType

- All Implemented Interfaces:
    `java.io.Serializable`, `java.lang.Comparable<StackExtensionType>`

      public enum StackExtensionType
      extends java.lang.Enum<StackExtensionType>

  Defines the types of extensions to a JavaScript stack that can be contributed to an extensible JavaScript stack.
  Since:
    5.3
  See Also:
    `StackExtension`, `ExtensibleJavaScriptStack`

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---
    `AGGREGATION_STRATEGY` | Overrides the JavaScript aggregation strategy for the stack.
    `INITIALIZATION` | Deprecated. Deprecated in 5.4 with no replacement; initialization may be removed in the future.
    `LIBRARY` | A JavaScript library.
    `MODULE` | A module to aggregate with the stack.
    `STACK` | A dependency on another JavaScriptStack.
    `STYLESHEET` | A stylesheet.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static StackExtensionType` | `valueOf​(java.lang.String name)` | Returns the enum constant of this type with the specified name.
    `static StackExtensionType[]` | `values()` | Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### LIBRARY

          public static final StackExtensionType LIBRARY

      A JavaScript library. The extension value will be converted using `AssetSource.getExpandedAsset(String)`, meaning that symbols will be expanded.
      See Also:
        `JavaScriptSupport.importJavaScriptLibrary(org.apache.tapestry5.Asset)`, `JavaScriptStack.getJavaScriptLibraries()`

    - #### STACK

          public static final StackExtensionType STACK

      A dependency on another JavaScriptStack. Note that this is especially useful as, starting in 5.4, there is no automatic dependency on the "core" stack, as there was in earlier versions.
      Since:
        5.4
      See Also:
        `JavaScriptSupport.importStack(String)`, `JavaScriptStack.getStylesheets()`

    - #### STYLESHEET

          public static final StackExtensionType STYLESHEET

      A stylesheet. The extension value will be converted using `AssetSource.getExpandedAsset(String)`, meaning that symbols will be expanded.
      See Also:
        `JavaScriptSupport.importStylesheet(org.apache.tapestry5.Asset)`, `JavaScriptStack.getStylesheets()`

    - #### MODULE

          public static final StackExtensionType MODULE

      A module to aggregate with the stack. The module's JavaScript is included after any libraries. In development mode (with aggregation disabled), the library will be included individually. Unlike the RequireJS `r.js` tool, this does not process dependencies and is based on a simple regular expression parser. Note that this only loads the module's code and defines the module as available; the module's function will not be invoked unless `JavaScriptSupport.require(String)` is invoked to establish a dependency. Note that at this time, shimmed modules can not be aggregated into stacks properly; the shimmed module will be aggregated, but then will still be loaded via a subsequent HTTP request.
      Since:
        5.4

    - #### AGGREGATION_STRATEGY

          public static final StackExtensionType AGGREGATION_STRATEGY

      Overrides the JavaScript aggregation strategy for the stack. The value is string name of an `JavaScriptAggregationStrategy` value.
      Since:
        5.4

    - #### INITIALIZATION

          public static final StackExtensionType INITIALIZATION

      Deprecated.
      Deprecated in 5.4 with no replacement; initialization may be removed in the future.
      Extra JavaScript initialization (rarely used). No symbol expansion takes place.
      See Also:
        `JavaScriptSupport.addScript(String, Object...)`, `JavaScriptStack.getInitialization()`

  - ### Method Detail

    - #### values

          public static StackExtensionType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (StackExtensionType c : StackExtensionType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static StackExtensionType valueOf​(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null