Class ViewRestSources
- java.lang.Object
-
- ru.vyarus.guicey.gsp.app.rest.mapping.ViewRestSources
-
public class ViewRestSources extends java.lang.ObjectApplication views rest mappings configuration object.- Since:
- 02.12.2019
-
-
Constructor Summary
Constructors Constructor Description ViewRestSources()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>getPrefixes()java.lang.StringgetPrimaryPrefix()voidmap(java.lang.String prefix)Register root rest mapping prefix.voidmap(java.lang.String url, java.lang.String prefix)Register prefix for exact url path (path-mapped prefixes override root mapping).voidmerge(ViewRestSources prefixes)Merge configurations (in-app config with global extensions).
-
-
-
Method Detail
-
map
public void map(java.lang.String prefix)
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
public void map(java.lang.String url, java.lang.String prefix)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
public java.lang.String getPrimaryPrefix()
- Returns:
- primary view rest mapping prefix or null if not configured
-
getPrefixes
public java.util.Map<java.lang.String,java.lang.String> getPrefixes()
- Returns:
- configured prefixes mappings by url
-
merge
public void merge(ViewRestSources prefixes)
Merge configurations (in-app config with global extensions).Will throw error on configuration override attempt (configuration clash).
- Parameters:
prefixes- other prefixes configuration
-
-