WrapperTemplateModel
, AdapterTemplateModel
, TemplateHashModel
, TemplateHashModelEx
, TemplateModel
, TemplateModelWithAPISupport
, TemplateScalarModel
CollectionModel
, MapModel
public class StringModel extends BeanModel implements TemplateScalarModel
BeanModel
that exposes the return value of the Object.toString()
method through the TemplateScalarModel
interface.NOTHING
EMPTY_STRING
Constructor | Description |
---|---|
StringModel(java.lang.Object object,
BeansWrapper wrapper) |
Creates a new model that wraps the specified object with BeanModel + scalar
functionality.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.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, wrap
public StringModel(java.lang.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 java.lang.String getAsString()
Object.toString()
on the wrapped
object.getAsString
in interface TemplateScalarModel