public class DefaultViewProvider extends Object implements ViewProcessorProvider
ViewProvider with StatefulView instances management.
Use registerView(String, Class) to register View classes and mapping them to view names. A view name
must be unique whithin provider registered views.
View instances will be created according to view scope: for stateful views, an instance is created at first request (for each UI) and the same instance is returned to subsequent view requests. On the contrary, for standard views, a new instance is created and returned to Navigator for every view request.
View name fragment to match with registered view names is extracted from view request string (the URL part after
#! characters) using the longest first part before / character which corresponds to a
registered view name.
| Constructor and Description |
|---|
DefaultViewProvider()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
com.vaadin.navigator.View |
getView(String viewName) |
String |
getViewName(String viewAndParameters) |
com.vaadin.navigator.View |
processViewInstance(ViewConfiguration.ViewConfigurationProvider viewConfigurationProvider,
com.vaadin.navigator.View view)
Process given View instance for additional operations
|
void |
registerView(String viewName,
Class<? extends com.vaadin.navigator.View> viewClass)
Register a View class bounding it to given
viewName. |
public void registerView(String viewName, Class<? extends com.vaadin.navigator.View> viewClass) throws ViewConfiguration.ViewConfigurationException
viewName.
View name must be unique within registered views, otherwise a ViewConfigurationException is thrown.
viewName - View nameviewClass - View classViewConfiguration.ViewConfigurationException - Failed to register viewpublic String getViewName(String viewAndParameters)
getViewName in interface com.vaadin.navigator.ViewProviderpublic com.vaadin.navigator.View getView(String viewName)
getView in interface com.vaadin.navigator.ViewProviderpublic com.vaadin.navigator.View processViewInstance(ViewConfiguration.ViewConfigurationProvider viewConfigurationProvider, com.vaadin.navigator.View view) throws ViewConfiguration.ViewConfigurationException
ViewProcessorProviderprocessViewInstance in interface ViewProcessorProviderviewConfigurationProvider - ViewConfigurationProviderview - View instanceViewConfiguration.ViewConfigurationException - Error processing View instanceCopyright © 2019 The Holon Platform. All rights reserved.