org.araneaframework
Interface Extendable

All Known Subinterfaces:
HttpInputData, HttpOutputData, InputData, OutputData
All Known Implementing Classes:
StandardServletInputData, StandardServletOutputData

public interface Extendable

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);
 
 

Author:
"Toomas Römer" , Jevgeni Kabanov (ekabanov at araneaframework dot org)
See Also:
Narrowable

Method Summary
 void extend(Class interfaceClass, Object extension)
          Adds an extension to the class, an interface with its implementation.
 

Method Detail

extend

public void extend(Class interfaceClass,
                   Object extension)
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
extension - a implementation of the interfaceClass