Enum Class ResourcePhase

java.lang.Object
java.lang.Enum<ResourcePhase>
com.atlassian.webresource.api.assembler.resource.ResourcePhase
All Implemented Interfaces:
Serializable, Comparable<ResourcePhase>, Constable

public enum ResourcePhase extends Enum<ResourcePhase>
Defines the current resource phases. THE ORDER OF THE ENUMERABLES MATTERS. BE CAREFUL WHEN ADDING NEW TYPES. Ordered from earliest to the latest phase
  • Enum Constant Details

    • INLINE

      public static final ResourcePhase INLINE
      Code is rendered directly to the HTTP response. When rendering to HTML, code will render inside <style> and <script> tags. In other rendering contexts, the text content will be returned.
    • REQUIRE

      public static final ResourcePhase REQUIRE
      Code should be loaded and run immediately as the client encounters it, blocking further HTML parsing.

      When rendering to HTML, code will be referenced by URL, accessed via <script src=""> or <link href=""> as appropriate.

    • DEFER

      public static final ResourcePhase DEFER
      Code should start loading when the client encounters it, but should not execute until code in the INLINE and REQUIRE phases has executed and the initial HTTP response has completed. In a browser context, this means when the closing </html> tag is encountered.

      When rendering to HTML, code will be referenced by URL, accessed via <script defer src=""> or <link href=""> as appropriate.

    • INTERACTION

      public static final ResourcePhase INTERACTION
      Intended for page’s non-critical, dynamic behaviours. Code only runs after all page render scripts completed.
  • Method Details

    • values

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

      public static ResourcePhase valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getPhaseOrDefault

      public static ResourcePhase getPhaseOrDefault(@Nullable String phase)
    • defaultPhase

      public static ResourcePhase defaultPhase()
      Method responsible for managing the default phase.
      Returns:
      Returns the current default phase.