public interface ModelAdaptor
M
with property method M.foo()
(as opposed
to M.getFoo()
), we can register a model adaptor object, adap
,
that converts a lookup for property foo
into a call to
M.foo()
.
Given <a.foo>
, we look up foo
via the adaptor if
a instanceof M
.Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getProperty(Interpreter interp,
ST self,
java.lang.Object o,
java.lang.Object property,
java.lang.String propertyName)
Lookup property name in
o and return its value. |
java.lang.Object getProperty(Interpreter interp, ST self, java.lang.Object o, java.lang.Object property, java.lang.String propertyName) throws STNoSuchPropertyException
o
and return its value.
property
is normally a String
but doesn't have to be.
E.g., if o
is Map
, property
could be
any key type. If we need to convert to String
, then it's done by
ST
and passed in here.STNoSuchPropertyException