Enum Class ResourcePhase
- All Implemented Interfaces:
Serializable,Comparable<ResourcePhase>,Constable
Defines the current resource phases.
THE ORDER OF THE ENUMERABLES MATTERS. BE CAREFUL WHEN ADDING NEW TYPES.
Ordered from earliest to the latest phase
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCode is rendered directly to the HTTP response.Intended for page’s non-critical, dynamic behaviours.Code should be loaded and run immediately as the client encounters it, blocking further HTML parsing. -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourcePhaseMethod responsible for managing the default phase.static ResourcePhasegetPhaseOrDefault(String phase) static ResourcePhaseReturns the enum constant of this class with the specified name.static ResourcePhase[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
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
Code should start loading when the client encounters it, but should not execute until code in theINLINEandREQUIREphases 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
Intended for page’s non-critical, dynamic behaviours. Code only runs after all page render scripts completed.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getPhaseOrDefault
-
defaultPhase
Method responsible for managing the default phase.- Returns:
- Returns the current default phase.
-