public class URLPatternMatcher extends Object
Page.path()
Constructor and Description |
---|
URLPatternMatcher() |
Modifier and Type | Method and Description |
---|---|
void |
add(String urlTemplate,
String pageName)
Adds the allowed URL template as specified in the
Page.path() by the developer. |
static URLPattern |
generatePattern(String urlTemplate)
Generates a
URLPattern from a Page.path() |
String |
getPageName(String typedURL) |
URLPattern |
getURLPattern(String pageName) |
HistoryToken |
parseURL(String url)
Creates a
HistoryToken by parsing a URL path. |
void |
setAsDefaultPage(String defaultPage)
Declares the default page to be matched against the empty string pattern.
|
public void add(String urlTemplate, String pageName)
Page.path()
by the developer.urlTemplate
- The page URL pattern specified in the Page.path()
.pageName
- The name of the page.public static URLPattern generatePattern(String urlTemplate)
URLPattern
from a Page.path()
urlTemplate
- The Page.path()
URLPattern
used to match URLspublic HistoryToken parseURL(String url)
HistoryToken
by parsing a URL path. This path should never include the application context.public void setAsDefaultPage(String defaultPage)
defaultPage
- Never null. Must match a page that has already been added with add(String, String)
public URLPattern getURLPattern(String pageName)
pageName
- The name of the page corresponding to the URLPattern
URLPattern
for the given page name.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.