Package org.apache.tapestry5.services.javascript

## Interface Initialization

-     public interface Initialization

  Provided by `JavaScriptSupport.require(String)` to allow additional, optional, details of the module-based page initialization to be configured.
  Since:
    5.4

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Initialization` | `invoke​(String functionName)` | Specifies the function to invoke.
    `Initialization` | `priority​(InitializationPriority priority)` | Changes the initialization priority of the initialization from its default, `InitializationPriority.NORMAL`.
    `void` | `with​(Object... arguments)` | Specifies the arguments to be passed to the function.

- - ### Method Detail

    - #### invoke

          Initialization invoke​(String functionName)

      Specifies the function to invoke. If this method is not invoked, then the module is expected to export just a single function (which may, or may not, take parameters).
      Parameters:
        `functionName` - name of a function exported by the module.
      Returns:
        this Initialization, for further configuration

    - #### priority

          Initialization priority​(InitializationPriority priority)

      Changes the initialization priority of the initialization from its default, `InitializationPriority.NORMAL`. Note: it is possible that this method may be removed before release 5.4 is final.
      Parameters:
        `priority` - new priority
      Returns:
        this Initialization, for further configuration

    - #### with

          void with​(Object... arguments)

      Specifies the arguments to be passed to the function. Often, just a single `JSONObject` is passed. When multiple Initializations exist with the same function name (or no function name), and no arguments, they are coalesced into a single Initialization: it is assumed that an initialization with no parameters needs to only be invoked once.
      Parameters:
        `arguments` - any number of values. Each value may be one of: null, String, Boolean, Number, `JSONObject`, `JSONArray`, or `JSONLiteral`.