Package org.apache.tapestry5.services.javascript

# Enum StackExtensionType

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

All Implemented Interfaces:
  `Serializable`, `Comparable<StackExtensionType>`, `java.lang.constant.Constable`

public enum StackExtensionType extends 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`

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## 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

  Modifier and Type
  Method
  Description
  `static StackExtensionType`
  `valueOf(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, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

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

- ## Enum Constant Details

  - ### 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 Details

  - ### values

    public static StackExtensionType[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    Returns:
      an array containing the constants of this enum type, in the order they are declared

  - ### valueOf

    public static StackExtensionType valueOf(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:
      `IllegalArgumentException` - if this enum type has no constant with the specified name
      `NullPointerException` - if the argument is null