public class Viewable extends Object
An abstraction that includes information about a view as well as an instance
of Models
and a ViewEngine
class, in
which only the view information is mandatory. Instances of this class can be
returned by controller methods.
If no Models
is specified, the view engine is required to
inject it; if no ViewEngine
is specified, then
the default selection mechanism to associate views and view engines is used.
Thus, a controller method returning an instance of this class can override
the Models
in request scope as well as the default lookup
mechanism for view engines.
Models
,
Controller
,
ViewEngine
Constructor and Description |
---|
Viewable(String view)
Constructs an instance specifying only a view.
|
Viewable(String view,
Class<? extends ViewEngine> viewEngine)
Constructs an instance using a view and a view engine.
|
Viewable(String view,
Models models)
Constructs an instance using a view and a models.
|
Viewable(String view,
Models models,
Class<? extends ViewEngine> viewEngine)
Constructs an instance using a view, a models and a view engine.
|
Modifier and Type | Method and Description |
---|---|
Models |
getModels() |
String |
getView() |
Class<? extends ViewEngine> |
getViewEngine() |
void |
setModels(Models models) |
void |
setView(String view) |
void |
setViewEngine(Class<? extends ViewEngine> viewEngine) |
public Viewable(String view)
view
- the view.public Viewable(String view, Class<? extends ViewEngine> viewEngine)
view
- the view.viewEngine
- the view engine class.public Viewable(String view, Models models)
view
- the view.models
- the models instance.public Viewable(String view, Models models, Class<? extends ViewEngine> viewEngine)
view
- the view.models
- the models instance.viewEngine
- the view engine class.public String getView()
public void setView(String view)
public Models getModels()
public void setModels(Models models)
public Class<? extends ViewEngine> getViewEngine()
public void setViewEngine(Class<? extends ViewEngine> viewEngine)
Copyright © 2015 Oracle Corporation. All rights reserved.