Package com.vaadin.flow.server
Class AppShellRegistry
- java.lang.Object
-
- com.vaadin.flow.server.AppShellRegistry
-
- All Implemented Interfaces:
Serializable
public class AppShellRegistry extends Object implements Serializable
The registry class forAppShellConfiguratorannotations.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAppShellRegistry.AppShellRegistryWrapperA wrapper class for storing theAppShellRegistryinstance in the servlet context.
-
Field Summary
Fields Modifier and Type Field Description static StringERROR_HEADER_NO_APP_CONFIGURATORstatic StringERROR_HEADER_NO_SHELLstatic StringERROR_HEADER_OFFENDING_CONFIGURATORstatic StringERROR_HEADER_OFFENDING_PWA
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static AppShellRegistrygetInstance(VaadinContext context)Returns the instance of the registry, or create a new one if it does not exist yet.Class<? extends AppShellConfigurator>getShell()Returns theAppShellConfiguratorclass in the application.booleanisShell(Class<?> clz)Deprecated.useAppShellPredicateto test whether the class is anAppShellConfiguratoror notvoidmodifyIndexHtml(org.jsoup.nodes.Document document, VaadinRequest request)Modifies the `index.html` document based on theAppShellConfiguratorannotations orAppShellConfigurator.configurePage(AppShellSettings)method.voidmodifyPushConfiguration(PushConfiguration pushConfiguration)Modifies PushConfiguration instance based on thePushannotation onAppShellConfigurator.voidreset()Reset the registry configuration so as it's possible to perform a new configuration and validation.voidsetShell(Class<? extends AppShellConfigurator> shell)Sets theAppShellConfiguratorclass in the application.StringtoString()StringvalidateClass(Class<?> clz)Checks whether a class have annotations that should only be inAppShellConfiguratorclasses.
-
-
-
Field Detail
-
ERROR_HEADER_NO_SHELL
public static final String ERROR_HEADER_NO_SHELL
- See Also:
- Constant Field Values
-
ERROR_HEADER_OFFENDING_PWA
public static final String ERROR_HEADER_OFFENDING_PWA
- See Also:
- Constant Field Values
-
ERROR_HEADER_NO_APP_CONFIGURATOR
public static final String ERROR_HEADER_NO_APP_CONFIGURATOR
- See Also:
- Constant Field Values
-
ERROR_HEADER_OFFENDING_CONFIGURATOR
public static final String ERROR_HEADER_OFFENDING_CONFIGURATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static AppShellRegistry getInstance(VaadinContext context)
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
public void setShell(Class<? extends AppShellConfigurator> shell)
Sets theAppShellConfiguratorclass in the application. Pass a null to reset the previous one when reusing the instance.- Parameters:
shell- the class implementing AppShellConfigurator.
-
getShell
public Class<? extends AppShellConfigurator> getShell()
Returns theAppShellConfiguratorclass in the application.- Returns:
- the app shell class
-
isShell
@Deprecated public boolean isShell(Class<?> clz)
Deprecated.useAppShellPredicateto test whether the class is anAppShellConfiguratoror notChecks whether the class is extendingAppShellConfigurator.- Parameters:
clz- the class to check.- Returns:
- true if the class extends
AppShellConfigurator.
-
validateClass
public String validateClass(Class<?> clz)
Checks whether a class have annotations that should only be inAppShellConfiguratorclasses.- Parameters:
clz- the class to check.- Returns:
- a string with the error lines if the class has offending annotations
-
modifyIndexHtml
public void modifyIndexHtml(org.jsoup.nodes.Document document, VaadinRequest request)Modifies the `index.html` document based on theAppShellConfiguratorannotations orAppShellConfigurator.configurePage(AppShellSettings)method.- Parameters:
document- a JSoup document for the index.html pagerequest- The request to handle
-
modifyPushConfiguration
public void modifyPushConfiguration(PushConfiguration pushConfiguration)
Modifies PushConfiguration instance based on thePushannotation onAppShellConfigurator.- Parameters:
pushConfiguration- the PushConfigration instance to modify
-
-