public abstract class NavigationGraph extends Object
PageNode and contain injected TransitionTo fields.
The concrete implementation of this class is usually generated at compile-time by scanning for
page classes. It is expected to fill in the pagesByName map in its constructor.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
NavigationGraph.PageNodeCreationalCallback<W extends org.jboss.elemento.IsElement> |
| Modifier and Type | Field and Description |
|---|---|
protected BeanManager |
beanManager |
protected Event<NavigationEvent> |
event |
protected Map<String,PageNode<?>> |
pagesByName
Maps page names to the classes that implement them.
|
protected Multimap<Class<? extends PageRole>,PageNode<?>> |
pagesByRole |
| Constructor and Description |
|---|
NavigationGraph() |
| Modifier and Type | Method and Description |
|---|---|
Collection<PageNode<?>> |
getAllPages() |
<C> PageNode<C> |
getPage(Class<C> type)
Returns an instance of the given page type.
|
<C> PageNode<C> |
getPage(String name)
Returns an instance of the given page type.
|
PageNode |
getPageByRole(Class<? extends UniquePageRole> role) |
Collection<PageNode<?>> |
getPagesByRole(Class<? extends PageRole> role)
Returns all pages that have the specified role.
|
boolean |
isEmpty()
Returns true if and only if there are no pages in this nagivation graph.
|
@Inject protected BeanManager beanManager
@Inject protected Event<NavigationEvent> event
protected final Map<String,PageNode<?>> pagesByName
public <C> PageNode<C> getPage(String name)
name - The page name, as defined by the implementation of page.public <C> PageNode<C> getPage(Class<C> type)
type - The Class object for the bean that implements the page.public Collection<PageNode<?>> getPagesByRole(Class<? extends PageRole> role)
getPage(Class) PageRolerole - the role used to lookup the pagespublic PageNode getPageByRole(Class<? extends UniquePageRole> role)
public boolean isEmpty()
public Collection<PageNode<?>> getAllPages()
PageNodes in the navigation graph.Copyright © 2020 Treblereel. All rights reserved.