jfun.yan.containers
Class TransformingContainer

java.lang.Object
  extended by jfun.yan.containers.SimpleContainer
      extended by jfun.yan.containers.TransformingContainer
All Implemented Interfaces:
java.io.Serializable, ComponentMap, Container, Registrar
Direct Known Subclasses:
ProxyContainer, SingletonContainer, SingletonProxyContainer

public class TransformingContainer
extends SimpleContainer

A Container that transforms a Component using a ComponentTransformer object before the component is registered into the container.

Codehaus.org.

Author:
Ben Yu
See Also:
Serialized Form

Constructor Summary
TransformingContainer(Registrar target, ComponentTransformer ct)
          Create a TransformingContainer object.
 
Method Summary
 void registerComponent(Component cc)
          Register a Component object in the container.
 void registerComponent(java.lang.Object key, Component cc)
          Register a Component identified by a key.
 
Methods inherited from class jfun.yan.containers.SimpleContainer
containsKey, containsType, defaultTransform, equals, getComponent, getComponentOfType, getComponents, getComponentsOfType, getComponentType, getDelegateTarget, getDependency, getDependency, getDependencyOfType, getDependencyOfType, getFactory, getFactory, getFactoryOfType, getFactoryOfType, getInstance, getInstance, getInstanceOfType, getInstanceOfType, getInstances, getInstances, getInstances, getInstances, getInstancesOfType, getInstancesOfType, hashCode, inherit, instantiateComponent, instantiateComponent, instantiateComponent, instantiateComponent, keys, registerConstructor, registerConstructor, registerConstructor, registerConstructor, registerStaticMethod, registerStaticMethod, registerStaticMethod, registerStaticMethod, registerValue, registerValue, toString, unregisterComponent, unregisterComponentsOfType, verify, verify, verifyComponent, verifyKey, verifyType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransformingContainer

public TransformingContainer(Registrar target,
                             ComponentTransformer ct)
Create a TransformingContainer object.

Parameters:
target - the registrar that stores the components.
ct - the transformer.
Method Detail

registerComponent

public void registerComponent(java.lang.Object key,
                              Component cc)
Description copied from interface: Registrar
Register a Component identified by a key.

Specified by:
registerComponent in interface Registrar
Overrides:
registerComponent in class SimpleContainer
Parameters:
key - the component key.
cc - the component.

registerComponent

public void registerComponent(Component cc)
Description copied from interface: Container
Register a Component object in the container. Equivalent as registerComponent(cc.getType(), cc). cc.getType() is not allowed to return null.

Specified by:
registerComponent in interface Container
Overrides:
registerComponent in class SimpleContainer
Parameters:
cc - the component.