public class PathBasedDecoratorSelector<C extends SiteMeshContext> extends Object implements DecoratorSelector<C>
DecoratorSelector implementation that selects a decorator based on the
incoming SiteMeshContext.getPath() and the mappings setup.
DecoratorSelector selector = new PathBasedDecoratorSelector()
.put("/*", "/decorators/default.html")
.put("/admin/*", "/decorators/admin.html")
.put("/thingy", "/decorators/thingy.html")
PathMapper| Constructor and Description |
|---|
PathBasedDecoratorSelector() |
| Modifier and Type | Method and Description |
|---|---|
PathMapper<String[]> |
getPathMapper()
Returns path mapper in use.
|
PathBasedDecoratorSelector |
put(String contentPath,
String... decoratorPaths) |
String[] |
selectDecoratorPaths(Content content,
C siteMeshContext)
Implementations should never return null.
|
public PathBasedDecoratorSelector put(String contentPath, String... decoratorPaths)
public String[] selectDecoratorPaths(Content content, C siteMeshContext) throws IOException
DecoratorSelectorselectDecoratorPaths in interface DecoratorSelector<C extends SiteMeshContext>IOExceptionpublic PathMapper<String[]> getPathMapper()
Copyright © 2015. All Rights Reserved.