Interface MenuSelector
- All Known Implementing Classes:
RequestMenuSelector
,TraversingMenuSelector
public interface MenuSelector
A MenuSelector is a strategy interface that searches a Menu tree and returns at most one Menu item that matches it.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MenuSelector
byHttpServletRequest
(@NonNull jakarta.servlet.http.HttpServletRequest request) Create aMenuSelector
that will look for the item best matching theHttpServletRequest
.static MenuSelector
Creates a MenuSelector that will look for the MenuItem with the given name.static MenuSelector
Creates a MenuSelector that will look for the MenuItem with the given path.static MenuSelector
Creates a MenuSelector that will look for the MenuItem with the given title.static MenuSelector
Creates a MenuSelector that will look for the MenuItem with the given url.Search the given Menu for an item that matches the current selector.
-
Method Details
-
byHttpServletRequest
static MenuSelector byHttpServletRequest(@NonNull @NonNull jakarta.servlet.http.HttpServletRequest request) Create aMenuSelector
that will look for the item best matching theHttpServletRequest
.- Parameters:
request
- to match with- Returns:
- selector
- See Also:
-
byPath
Creates a MenuSelector that will look for the MenuItem with the given path.- Parameters:
path
- Path to look for.- Returns:
- MenuSelector instance.
-
byUrl
Creates a MenuSelector that will look for the MenuItem with the given url.- Parameters:
url
- URL to look for.- Returns:
- MenuSelector instance.
-
byName
Creates a MenuSelector that will look for the MenuItem with the given name.- Parameters:
name
- Name to look for.- Returns:
- MenuSelector instance.
-
byTitle
Creates a MenuSelector that will look for the MenuItem with the given title.- Parameters:
title
- Title to look for.- Returns:
- MenuSelector instance.
-