| org.araneaframework.Extendable
Extendable | public interface Extendable (Code) | | Implementers can enrich their objects with external Objects
implementing certain interfaces. If a class implements Extendable
then it always should implement Narrowable too.
A typical use-case would be:
public SampleClass implements Extendable, Narrowable {
...
}
SampleClass obj = new SampleClass();
obj.extend(SomeInterface.class, someObj);
....
SomeInterface newObj = (SomeInterface)obj.narrow(SomeInterface.class);
See Also: org.araneaframework.Narrowable author: "Toomas Römer" author: Jevgeni Kabanov (ekabanov at araneaframework dot org) |
Method Summary | |
public void | extend(Class interfaceClass, Object extension) Adds an extension to the class, an interface with its implementation. |
extend | public void extend(Class interfaceClass, Object extension)(Code) | | Adds an extension to the class, an interface with its implementation.
Can later be used via narrow(Class)
if the class implements
Narrowable .
Parameters: interfaceClass - the interface of the extension being added Parameters: extension - a implementation of the interfaceClass |
|
|