| java.lang.Object org.picocontainer.behaviors.AbstractBehavior org.picocontainer.gems.behaviors.Assimilated
Assimilated | final public class Assimilated extends AbstractBehavior (Code) | | ComponentAdapter, that assimilates a component for a specific type.
Allows the instance of another
ComponentAdapter to be converted into interfacte type , that the
instance is not assignable from. In other words the instance of the delegated adapter does NOT necessarily implement the
type interface.
For Example:
public interface Foo {
int size();
}
public class Bar {
public int size() {
return 1;
}
}
new Assimilated(Foo.class, new InstanceAdapter(new Bar()));
Notice how Bar does not implement the interface Foo. But Bar does have an identical size() method.
author: Jörg Schaible author: Michael Ward |
Assimilated | public Assimilated(Class type, ComponentAdapter delegate, ProxyFactory proxyFactory) throws PicoCompositionException(Code) | | Construct an Assimilated. The type may not implement the type of the component instance.
If the component instance does implement the interface, no proxy is used though.
Parameters: type - The class type used as key. Parameters: delegate - The delegated ComponentAdapter. Parameters: proxyFactory - The ProxyFactory to use. throws: PicoCompositionException - Thrown if the type is not compatible and cannot be proxied. |
Assimilated | public Assimilated(Class type, ComponentAdapter delegate)(Code) | | Construct an Assimilated. The type may not implement the type of the component instance.
The implementation will use JDK
java.lang.reflect.Proxy instances. If the component instant does
implement the interface, no proxy is used anyway.
Parameters: type - The class type used as key. Parameters: delegate - The delegated ComponentAdapter. |
getComponentKey | public Object getComponentKey()(Code) | | Return the key of the component. If the key of the delegated component is a type, that is not compatible with the type to
assimilate, then the assimilated type replaces the original type.
See Also: AbstractBehavior.getComponentKey |
|
|