com.vaadin.flow.shared.ui.
Enum LoadMode
- java.lang.Object
-
- java.lang.Enum<LoadMode>
-
- com.vaadin.flow.shared.ui.LoadMode
-
All Implemented Interfaces:
public enum LoadMode extends Enum<LoadMode>
Determines a way that dependency is loaded. This mode can be specified when importing dependency either via annotations:
or viaPage
methods:Page.addJavaScript(String, LoadMode)
Page.addStyleSheet(String, LoadMode)
Page.addHtmlImport(String, LoadMode)
Since:
1.0.
Author:
Vaadin Ltd
-
-
Enum Constant Summary
Enum Constants Enum Constant and Description EAGER
Forces the dependency being loaded before the initial page load.
INLINE
Forced the dependency to be inlined in the body of the html page, removing the requirement to have additional roundtrips to fetch the script.
LAZY
Allows the dependency being loaded independent of the initial page load.
-
Method Summary
All Methods Modifier and Type Method and Description static LoadMode
valueOf(String name)
Returns the enum constant of this type with the specified name.
static LoadMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INLINE
public static final LoadMode INLINE
Forced the dependency to be inlined in the body of the html page, removing the requirement to have additional roundtrips to fetch the script.
It is guaranteed that all
INLINE
dependencies are loaded before anyLAZY
dependency.
-
EAGER
public static final LoadMode EAGER
Forces the dependency being loaded before the initial page load. This mode is suitable for situation when the application cannot start without the dependency being loaded first.
It is guaranteed that all
EAGER
dependencies are loaded before anyLAZY
dependency.
-
LAZY
public static final LoadMode LAZY
Allows the dependency being loaded independent of the initial page load. This mode is suitable for situation when the application have no strict requirements on dependency load time.
It is guaranteed that all
EAGER
dependencies are loaded before anyLAZY
dependency.
-
-
Method Detail
-
values
public static LoadMode[] 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 (LoadMode c : LoadMode.values()) System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LoadMode 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 nameNullPointerException
- if the argument is null
-
-