...
Code Block |
---|
public final void setObject(final Object object) { throw new UnsupportedOperationException("Model " + getClass() + " does not support setObject(Object)"); } |
Note that the LoadableDetachableModel
inherits from AbstractReadOnlyModel
.
The StringResourceModel
we talked about above is another fine example of loadable detachable (and therefore read-only) model, since resource strings are read-only in nature. Actually, the StringResourceModel
is a subclass of LoadableDetachableModel
.
...
The first example of property model is AbstractPropertyModel
. It provides implementation details for the PropertyModel
, CompoundPropertyModel
and BoundCompoundPropertyModel
classes we discussed above by implementing getObject()
and
setObject()
using a property expression and conversion type retrieved from a subclass via abstract method propertyExpression()
. The simple PropertyModel
class just returns the property expression and type it was constructed with:
...