public class StringModel extends BeanModel implements TemplateScalarModel
BeanModel that exposes the return value of the Object.toString() method through the TemplateScalarModel
interface.EMPTY_STRINGNOTHING| Constructor and Description |
|---|
StringModel(Object object,
BeansWrapper wrapper)
Creates a new model that wraps the specified object with BeanModel + scalar
functionality.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAsString()
Returns the result of calling
Object.toString() on the wrapped
object. |
get, getAdaptedObject, getAPI, getWrappedObject, hasPlainGetMethod, invokeGenericGet, isEmpty, keys, keySet, size, toString, unwrap, values, wrappublic StringModel(Object object, BeansWrapper wrapper)
object - the object to wrap into a model.wrapper - the BeansWrapper associated with this model.
Every model has to have an associated BeansWrapper instance. The
model gains many attributes from its wrapper, including the caching
behavior, method exposure level, method-over-item shadowing policy etc.public String getAsString()
Object.toString() on the wrapped
object.getAsString in interface TemplateScalarModel