Package ball.spring.dialect
Class WebJarsDialect.WebJars
- java.lang.Object
-
- ball.spring.dialect.WebJarsDialect.WebJars
-
- Enclosing class:
- WebJarsDialect
public static class WebJarsDialect.WebJars extends Object
WebJarsDialect.WebJars
Thymeleaf dialect expression object implementation.
-
-
Constructor Summary
Constructors Constructor Description WebJars()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<String>
assets(boolean useCdn, String scheme, String... patterns)
Method to return WebJar resources matchingAntPathMatcher
patterns.Collection<String>
assets(String... patterns)
Method to return WebJar resources matchingAntPathMatcher
patterns.String
cdn(String scheme, String path)
Method to convert a WebJar resource (partial) path to its corresponding CDN (URI) path.Map<String,String>
getJars()
-
-
-
Constructor Detail
-
WebJars
public WebJars()
-
-
Method Detail
-
assets
public Collection<String> assets(String... patterns)
Method to return WebJar resources matchingAntPathMatcher
patterns.- Parameters:
patterns
- TheAntPathMatcher
patterns to match.- Returns:
- The matching resource paths.
-
assets
public Collection<String> assets(boolean useCdn, String scheme, String... patterns)
Method to return WebJar resources matchingAntPathMatcher
patterns.- Parameters:
useCdn
-true
to provide a CDNURI
;false
for a local path.scheme
- TheURI
scheme.patterns
- TheAntPathMatcher
patterns to match.- Returns:
- The matching resource paths.
-
cdn
public String cdn(String scheme, String path)
Method to convert a WebJar resource (partial) path to its corresponding CDN (URI) path. Typical Thymeleaf usage:@{${#webjars.cdn(#request.scheme, path)}}
.- Parameters:
scheme
- TheURI
scheme.path
- The (possibly partial) path.- Returns:
- The CDN URI if one may be constructed;
path
otherwise.
-
getJars
public Map<String,String> getJars()
- Returns:
- Result of
WebJarAssetLocator.getWebJars()
call.
-
-