public class PwaConfiguration extends Object implements Serializable
PWA
annotation.
Takes PWA
in constructor to fill properties. Sanitizes the input and
falls back to default values if PWA
is unavailable (null
).Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_BACKGROUND_COLOR |
static String |
DEFAULT_DISPLAY |
static String |
DEFAULT_ICON |
static String |
DEFAULT_NAME |
static String |
DEFAULT_OFFLINE_PATH |
static String |
DEFAULT_PATH |
static String |
DEFAULT_START_URL |
static String |
DEFAULT_THEME_COLOR |
Constructor and Description |
---|
PwaConfiguration()
Default constructor, uses default values.
|
PwaConfiguration(boolean enabled,
String name,
String shortName,
String description,
String backgroundColor,
String themeColor,
String iconPath,
String manifestPath,
String offlinePath,
String display,
String startPath,
String[] offlineResources)
Constructs a configuration from individual values.
|
PwaConfiguration(PWA pwa)
Constructs the configuration using the
PWA annotation. |
Modifier and Type | Method and Description |
---|---|
String |
getAppName()
Gets the application name.
|
String |
getBackgroundColor()
Gets the background color of the application.
|
String |
getDescription()
Gets the application description.
|
String |
getDisplay()
Gets the the developers? preferred display mode for the website.
|
String |
getIconPath()
Gets the path to the application icon file.
|
String |
getManifestPath()
Gets the path to the manifest.webmanifest.
|
String |
getOfflinePath()
Path to static offline html file.
|
List<String> |
getOfflineResources()
Gets the list of files to be added to pre cache.
|
String |
getServiceWorkerPath()
Gets the path to the service worker.
|
String |
getShortName()
Gets the application short name.
|
String |
getStartUrl()
Gets the start url of the PWA application.
|
String |
getThemeColor()
Gets the theme color of the application.
|
boolean |
isEnabled()
Is PWA enabled.
|
boolean |
isOfflinePathEnabled()
Is static offline HTML used for offline mode.
|
String |
relIconPath()
Gets the ath to icon with prefix, so request matches.
|
String |
relManifestPath()
Path to manifest with prefix, so request matches.
|
String |
relOfflinePath()
Path to offline file with prefix, so request matches.
|
String |
relServiceWorkerPath()
Gets the path to service worker with prefix, so request matches.
|
public static final String DEFAULT_PATH
public static final String DEFAULT_ICON
public static final String DEFAULT_NAME
public static final String DEFAULT_THEME_COLOR
public static final String DEFAULT_BACKGROUND_COLOR
public static final String DEFAULT_DISPLAY
public static final String DEFAULT_OFFLINE_PATH
public static final String DEFAULT_START_URL
public PwaConfiguration()
public PwaConfiguration(PWA pwa)
PWA
annotation.pwa
- the annotation to use for configurationpublic PwaConfiguration(boolean enabled, String name, String shortName, String description, String backgroundColor, String themeColor, String iconPath, String manifestPath, String offlinePath, String display, String startPath, String[] offlineResources)
enabled
- is PWA enabledname
- the application nameshortName
- the application short namedescription
- the description of the applicationbackgroundColor
- the background colorthemeColor
- the theme coloriconPath
- the icon file pathmanifestPath
- the `manifest.webmanifest` file pathofflinePath
- the static offline HTML file pathdisplay
- the display modestartPath
- the start pathofflineResources
- the list of files to add for pre-cachingpublic String getAppName()
public String getShortName()
public String getDescription()
public String getBackgroundColor()
public String getThemeColor()
public String getIconPath()
Example: img/my-icon.png
public String relIconPath()
public String getManifestPath()
public String relManifestPath()
public String getOfflinePath()
public String relOfflinePath()
public String getServiceWorkerPath()
public String relServiceWorkerPath()
public List<String> getOfflineResources()
public String getDisplay()
public String getStartUrl()
Used in manifest as start url.
public boolean isEnabled()
public boolean isOfflinePathEnabled()
PWA.offlinePath()
value in PWA annotation to enable.Copyright © 2021. All rights reserved.