org.sitemesh.config
Class PathBasedDecoratorSelector<C extends SiteMeshContext>
java.lang.Object
org.sitemesh.config.PathBasedDecoratorSelector<C>
- All Implemented Interfaces:
- DecoratorSelector<C>
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.
Example
DecoratorSelector selector = new PathBasedDecoratorSelector()
.put("/*", "/decorators/default.html")
.put("/admin/*", "/decorators/admin.html")
.put("/thingy", "/decorators/thingy.html")
- Author:
- Joe Walnes
- See Also:
PathMapper
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PathBasedDecoratorSelector
public PathBasedDecoratorSelector()
put
public PathBasedDecoratorSelector put(String contentPath,
String... decoratorPaths)
selectDecoratorPaths
public String[] selectDecoratorPaths(Content content,
C siteMeshContext)
throws IOException
- Description copied from interface:
DecoratorSelector
- Implementations should never return null.
- Specified by:
selectDecoratorPaths in interface DecoratorSelector<C extends SiteMeshContext>
- Throws:
IOException
Copyright © 2011. All Rights Reserved.