public class NavigationItem {
- private final String matchingWildcard;
+ private String matchingPattern;
private final Map<Locale, String> localeToTitle = new HashMap<Locale, String>();
ArrayList<NavigationItem> subElements = new ArrayList<NavigationItem>();
private Locale[] localeOrder;
public NavigationItem(final Locale... localeOrder) {
this.localeOrder = localeOrder;
- matchingWildcard = null;
+ matchingPattern = null;
linkUrl = null;
}
final String... titles) {
this.parent = parent;
this.linkUrl = linkUrl;
- matchingWildcard = linkUrl;
+ matchingPattern = linkUrl;
initializeLocalizedTitles(titles);
}
}
public boolean matchesUrl(final String url) {
- return WildCardMatcher.match(url, matchingWildcard);
+ return WildCardMatcher.match(url, matchingPattern);
}
+ public NavigationItem setPattern(final String pattern) {
+ matchingPattern = pattern;
+ return this;
+ }
+
}