com.vaadin.flow.server.
Class AppShellRegistry
- java.lang.Object
-
- com.vaadin.flow.server.AppShellRegistry
-
All Implemented Interfaces:
public class AppShellRegistry extends Object implements Serializable
The registry class for
AppShellConfigurator
annotations.Since:
3.0
See Also:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
AppShellRegistry.AppShellRegistryWrapper
A wrapper class for storing the
AppShellRegistry
instance in the servlet context.
-
Field Summary
Fields Modifier and Type Field and Description static String
ERROR_HEADER_NO_APP_CONFIGURATOR
static String
ERROR_HEADER_NO_SHELL
static String
ERROR_HEADER_OFFENDING
static String
ERROR_HEADER_OFFENDING_CONFIGURATOR
-
Constructor Summary
Constructors Constructor and Description AppShellRegistry()
-
Method Summary
All Methods Modifier and Type Method and Description static 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 the
AppShellConfigurator
class in the application.String
getTitle()
Return the text content of the title tag in the application shell.
boolean
isShell(Class<?> clz)
Checks whether the class is extending
AppShellConfigurator
.void
modifyIndexHtml(org.jsoup.nodes.Document document, VaadinRequest request)
Modifies the `index.html` document based on the
AppShellConfigurator
annotations orAppShellConfigurator.configurePage(AppShellSettings)
method.void
modifyPushConfiguration(PushConfiguration pushConfiguration)
Modifies PushConfiguration instance based on the
Push
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 the
AppShellConfigurator
class in the application.String
toString()
String
validateClass(Class<?> clz)
Checks whether a class have annotations that should only be in
AppShellConfigurator
classes.
-
-
-
Field Detail
-
ERROR_HEADER_NO_SHELL
public static final String ERROR_HEADER_NO_SHELL
See Also:
-
ERROR_HEADER_OFFENDING
public static final String ERROR_HEADER_OFFENDING
See Also:
-
ERROR_HEADER_NO_APP_CONFIGURATOR
public static final String ERROR_HEADER_NO_APP_CONFIGURATOR
See Also:
-
ERROR_HEADER_OFFENDING_CONFIGURATOR
public static final String ERROR_HEADER_OFFENDING_CONFIGURATOR
See Also:
-
-
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 contextReturns:
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 the
AppShellConfigurator
class in the application. Pass a null to reset the previous one when reusing the instance.Parameters:
shell
- the class extending VaadinAppShell class.
-
getShell
public Class<? extends AppShellConfigurator> getShell()
Returns the
AppShellConfigurator
class in the application.Returns:
the app shell class
-
isShell
public boolean isShell(Class<?> clz)
Checks whether the class is extending
AppShellConfigurator
.Parameters:
clz
- the class to check.Returns:
true if the class extends
AppShellConfigurator
.
-
getTitle
public String getTitle()
Return the text content of the title tag in the application shell.
Returns:
title;
-
validateClass
public String validateClass(Class<?> clz)
Checks whether a class have annotations that should only be in
AppShellConfigurator
classes.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 the
AppShellConfigurator
annotations 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 the
Push
annotation onAppShellConfigurator
.Parameters:
pushConfiguration
- the PushConfigration instance to modify
-
-