Class ViewRestSources
java.lang.Object
ru.vyarus.guicey.gsp.app.rest.mapping.ViewRestSources
Application views rest mappings configuration object.
- Since:
- 02.12.2019
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegister root rest mapping prefix.voidRegister prefix for exact url path (path-mapped prefixes override root mapping).voidmerge(ViewRestSources prefixes) Merge configurations (in-app config with global extensions).
-
Constructor Details
-
ViewRestSources
public ViewRestSources()
-
-
Method Details
-
map
Register root rest mapping prefix.Registration may be performed only once: overrides are not allowed. Most likely, gsp application will have configured root mapping, so use carefully in extensions.
- Parameters:
prefix- view rest mapping prefix
-
map
Register prefix for exact url path (path-mapped prefixes override root mapping).Internally, path used without first slash to simplify matching.
Only one prefix may be registered per url. In case of overriding registration error will be thrown.
Pay attention that additional asset locations registration may be required, because only templates relative to view class will be correctly resolved, but direct templates may fail to resolve.
- Parameters:
url- sub urlprefix- asset classpath location
-
getPrimaryPrefix
- Returns:
- primary view rest mapping prefix or null if not configured
-
getPrefixes
- Returns:
- configured prefixes mappings by url
-
merge
Merge configurations (in-app config with global extensions).Will throw error on configuration override attempt (configuration clash).
- Parameters:
prefixes- other prefixes configuration
-