public static class Navigator.ClassBasedViewProvider extends Object implements ViewProvider
Note that the view class must be accessible by the class loader used by the provider. This may require its visibility to be public.
This class is primarily for internal use by Navigator
.
Constructor and Description |
---|
ClassBasedViewProvider(String viewName,
Class<? extends View> viewClass)
Create a new view provider which creates new view instances based on
a view class.
|
Modifier and Type | Method and Description |
---|---|
View |
getView(String viewName)
Create or return a pre-created instance of a view.
|
Class<? extends View> |
getViewClass()
Get the view class for this provider.
|
String |
getViewName()
Get the view name for this provider.
|
String |
getViewName(String navigationState)
Extract the view name from a combined view name and parameter string.
|
public ClassBasedViewProvider(String viewName, Class<? extends View> viewClass)
viewName
- name of the views to create (not null)viewClass
- class to instantiate when a view is requested (not null)public String getViewName(String navigationState)
ViewProvider
getViewName
in interface ViewProvider
navigationState
- string with view name and its fragment parameters (if given),
not nullpublic View getView(String viewName)
ViewProvider
getView
in interface ViewProvider
viewName
- name of the view, not nullpublic String getViewName()
Copyright © 2023 Vaadin Ltd. All rights reserved.