Package com.vaadin.flow.server
Class AppShellRegistry
java.lang.Object
com.vaadin.flow.server.AppShellRegistry
- All Implemented Interfaces:
Serializable
The registry class for
AppShellConfigurator
annotations.- Since:
- 3.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A wrapper class for storing theAppShellRegistry
instance in the servlet context. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AppShellRegistry
getInstance
(VaadinContext context) Returns the instance of the registry, or create a new one if it does not exist yet.Class<? extends AppShellConfigurator>
getShell()
Returns theAppShellConfigurator
class in the application.void
modifyIndexHtml
(org.jsoup.nodes.Document document, VaadinRequest request) Modifies the `index.html` document based on theAppShellConfigurator
annotations orAppShellConfigurator.configurePage(AppShellSettings)
method.void
modifyPushConfiguration
(PushConfiguration pushConfiguration) Modifies PushConfiguration instance based on thePush
annotation onAppShellConfigurator
.void
reset()
Reset the registry configuration so as it's possible to perform a new configuration and validation.void
setShell
(Class<? extends AppShellConfigurator> shell) Sets theAppShellConfigurator
class in the application.toString()
validateClass
(Class<?> clz) Checks whether a class have annotations that should only be inAppShellConfigurator
classes.
-
Field Details
-
ERROR_HEADER_NO_SHELL
- See Also:
-
ERROR_HEADER_OFFENDING_PWA
- See Also:
-
-
Method Details
-
getInstance
Returns the instance of the registry, or create a new one if it does not exist yet.- Parameters:
context
- servlet context- Returns:
- the registry instance
-
reset
public void reset()Reset the registry configuration so as it's possible to perform a new configuration and validation. -
setShell
Sets theAppShellConfigurator
class in the application. Pass a null to reset the previous one when reusing the instance.- Parameters:
shell
- the class implementing AppShellConfigurator.
-
getShell
Returns theAppShellConfigurator
class in the application.- Returns:
- the app shell class
-
validateClass
Checks whether a class have annotations that should only be inAppShellConfigurator
classes.- Parameters:
clz
- the class to check.- Returns:
- a string with the error lines if the class has offending annotations
-
modifyIndexHtml
Modifies the `index.html` document based on theAppShellConfigurator
annotations orAppShellConfigurator.configurePage(AppShellSettings)
method.- Parameters:
document
- a JSoup document for the index.html pagerequest
- The request to handle
-
modifyPushConfiguration
Modifies PushConfiguration instance based on thePush
annotation onAppShellConfigurator
.- Parameters:
pushConfiguration
- the PushConfigration instance to modify
-
toString
-