public class Viewable extends Object
Template annotation
then the class of the last matching resource should be utilized as the resolving class.
error
will result.
ViewableContext is responsible for
resolving absolute template name from relative template name.Template,
ViewableContext,
ResolvingViewableContext| Constructor and Description |
|---|
Viewable(String templateName)
Construct a new viewable type with a template name.
|
Viewable(String templateName,
Object model)
Construct a new viewable type with a template name and a model.
|
Viewable(String templateName,
Object model,
Class<?> resolvingClass)
Construct a new viewable type with a template name, a model
and a resolving class.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getModel()
Get the model.
|
Class<?> |
getResolvingClass()
Get the resolving class.
|
String |
getTemplateName()
Get the template name.
|
boolean |
isTemplateNameAbsolute()
Determines whether the template name is represented by an absolute path.
|
public Viewable(String templateName) throws IllegalArgumentException
null.templateName - the template name, shall not be null.IllegalArgumentException - if the template name is null.public Viewable(String templateName, Object model) throws IllegalArgumentException
templateName - the template name, shall not be null.model - the model, may be null.IllegalArgumentException - if the template name is null.public Viewable(String templateName, Object model, Class<?> resolvingClass) throws IllegalArgumentException
templateName - the template name, shall not be null.model - the model, may be null.resolvingClass - the class to use to resolve the template name if the template is not absolute,
if null then the resolving class will be obtained from the last matching resource.IllegalArgumentException - if the template name is null.public String getTemplateName()
public Object getModel()
public Class<?> getResolvingClass()
public boolean isTemplateNameAbsolute()
true if the template name is absolute, and starts with a
'/' character, false otherwise.Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.