Package ru.vyarus.guicey.gsp.info.model
Class GspApp
java.lang.Object
ru.vyarus.guicey.gsp.info.model.GspApp
Information model for registered gsp application.
- Since:
- 03.12.2019
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturned assets are sorted for resolution: registration order of packages is preserved in order to be able to override resources from previous registrations.Default error page has -1 code.Hidden methods appear when sub url mapped to different rest prefix, making all root rest paths under the same prefix unreachable.Never starts with slash and always ends with slash.getName()May be used to construct full rest urls (relative to server root).getViews()When root mapping is not explicitly declared, its set to application name (so map will never be empty).booleanbooleanbooleanbooleanisSpa()voidsetAssetExtensions(com.google.common.collect.Multimap<String, String> assetExtensions) voidvoidsetErrorPages(Map<Integer, String> errorPages) voidsetFilesRegex(String filesRegex) voidsetHasDefaultFilesRegex(boolean hasDefaultFilesRegex) voidsetHasDefaultSpaRegex(boolean hasDefaultSpaRegex) voidsetHiddenViewPaths(List<HiddenViewPath> hiddenViewPaths) voidsetIndexFile(String indexFile) voidsetMainAssetsLocation(String mainAssetsLocation) voidsetMainContext(boolean mainContext) voidsetMappingUrl(String mappingUrl) voidvoidsetRequiredRenderers(List<String> requiredRenderers) voidsetRestRootUrl(String restRootUrl) voidsetRootUrl(String rootUrl) voidsetSpa(boolean spa) voidsetSpaRegex(String spaRegex) voidsetViewExtensions(Map<String, String> viewExtensions) voidsetViewPaths(List<MappedViewPath> viewPaths) void
-
Constructor Details
-
GspApp
public GspApp()
-
-
Method Details
-
getName
- Returns:
- application name
-
setName
-
isMainContext
public boolean isMainContext()- Returns:
- true for main context, false for admin
-
setMainContext
public void setMainContext(boolean mainContext) -
getMappingUrl
- Returns:
- application mapping url (relative to context)
-
setMappingUrl
-
getRootUrl
- Returns:
- application mapping url prefixed with context (full url relative to server root)
-
setRootUrl
-
getRequiredRenderers
- Returns:
- list of required renderers or empty list
-
setRequiredRenderers
-
getMainAssetsLocation
Never starts with slash and always ends with slash.- Returns:
- main assets classpath location
-
setMainAssetsLocation
-
getAssets
Returned assets are sorted for resolution: registration order of packages is preserved in order to be able to override resources from previous registrations. In returned model registration order is reversed, so the latest registered package will be the first (simply to check it first - correctly handle overrides).Contexts never starts with slash, but always ends (for proper matching). Root context is empty string. Classpath locations never starts with slash and always ends with slash.
- Returns:
- all application asset mappings (including extensions)
-
setAssets
-
getViews
When root mapping is not explicitly declared, its set to application name (so map will never be empty).Contexts never starts with slash, but always ends (for proper matching). Root context is empty string. Rest prefixes never starts with slash and always ends with slash (for proper matching).
- Returns:
- all application view mappings (including extensions)
-
setViews
-
getMainRestPrefix
- Returns:
- main rest mapping prefix
-
getAssetExtensions
- Returns:
- only extension asset declarations or empty map
-
setAssetExtensions
-
getViewExtensions
- Returns:
- only extension view rest mappings or empty map
-
setViewExtensions
-
getRestRootUrl
May be used to construct full rest urls (relative to server root).- Returns:
- rest context mapping url or null when jetty not yet started
-
setRestRootUrl
-
getIndexFile
- Returns:
- configured index file (empty string by default, meaning index.html)
-
setIndexFile
-
getFilesRegex
- Returns:
- asset (static resources) calls detection regexp
-
setFilesRegex
-
isHasDefaultFilesRegex
public boolean isHasDefaultFilesRegex()- Returns:
- true when default assets detection regexp used, false otherwise
-
setHasDefaultFilesRegex
public void setHasDefaultFilesRegex(boolean hasDefaultFilesRegex) -
isSpa
public boolean isSpa()- Returns:
- true when spa routing enabled (serve index page for all requested paths, except assets), false when disabled (default)
-
setSpa
public void setSpa(boolean spa) -
getSpaRegex
- Returns:
- non spa route path recognition regexp
-
setSpaRegex
-
isHasDefaultSpaRegex
public boolean isHasDefaultSpaRegex()- Returns:
- true when defaul regexp used, false otherwise
-
setHasDefaultSpaRegex
public void setHasDefaultSpaRegex(boolean hasDefaultSpaRegex) -
getErrorPages
Default error page has -1 code.- Returns:
- configured error pages (mapping by code) or empty map if nothing configured
-
setErrorPages
-
getDefaultErrorPage
- Returns:
- default error page (for all non mapped error codes) or null if not declared
-
getViewPaths
- Returns:
- mapped view rest methods
-
setViewPaths
-
getHiddenViewPaths
Hidden methods appear when sub url mapped to different rest prefix, making all root rest paths under the same prefix unreachable.- Returns:
- hidden view rest method
-
setHiddenViewPaths
-