|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfun.yan.containers.InheritedRegistrar
public class InheritedRegistrar
This class manages parent-child relationship between two conainers. In this container, components in the child container can use those from parent container as dependency. But components from parent container cannot see those from child containers.
Codehaus.org.
| Constructor Summary | |
|---|---|
InheritedRegistrar(Registrar parent,
Registrar child)
Create an InheritedRegistrar object. |
|
| Method Summary | |
|---|---|
boolean |
containsKey(java.lang.Object key)
Whether a Component with a certain key is contained in the map. |
boolean |
containsType(java.lang.Class type)
Whether a Component of a certain type or its sub-type is contained in the map. |
boolean |
equals(java.lang.Object obj)
|
Registrar |
getChild()
Get the child container. |
Component |
getComponent(java.lang.Object key)
retrieves a component identified by a key. |
Component |
getComponentOfType(java.lang.Class type)
retrieves a component of a provided type. |
java.util.Collection |
getComponents()
gets all components from both the parent container and the child container. |
java.util.List |
getComponentsOfType(java.lang.Class type)
retrieves all components of a provided type from both the parent container and the child container. |
Dependency |
getDependency(java.lang.Object key,
ComponentMap cmap)
Gets the Dependency object for a component identified by a key. |
Dependency |
getDependencyOfType(java.lang.Class type,
ComponentMap cmap)
Gets the Dependency object for a component of a provided type. |
Registrar |
getParent()
Get the parent container. |
int |
hashCode()
|
java.util.Set |
keys()
Get the component keys from both parent and child containers. |
void |
registerComponent(java.lang.Object key,
Component cc)
registers the component to the child container. |
java.lang.String |
toString()
|
void |
unregisterComponent(java.lang.Object key)
unregisters a component identified by a key from child container. |
void |
unregisterComponentsOfType(java.lang.Class type)
unregisters components of a provided type from child container. |
void |
verify(ComponentMap cmap)
Verifies all components in this container. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public InheritedRegistrar(Registrar parent,
Registrar child)
parent - the parent container.child - the child contaiiner.| Method Detail |
|---|
public Registrar getChild()
public Registrar getParent()
public void registerComponent(java.lang.Object key,
Component cc)
registerComponent in interface Registrarkey - the component key.cc - the component.public void unregisterComponentsOfType(java.lang.Class type)
unregisterComponentsOfType in interface Registrartype - the component instance type.public void unregisterComponent(java.lang.Object key)
unregisterComponent in interface Registrarkey - the component key.public boolean containsKey(java.lang.Object key)
ComponentMap
containsKey in interface ComponentMapkey - the component key.
public boolean containsType(java.lang.Class type)
ComponentMap
containsType in interface ComponentMaptype - the type of the component.
public Component getComponent(java.lang.Object key)
getComponent in interface ComponentMapkey - the component key.
public Component getComponentOfType(java.lang.Class type)
getComponentOfType in interface ComponentMaptype - the component instance type.
public java.util.List getComponentsOfType(java.lang.Class type)
getComponentsOfType in interface ComponentMaptype - the component instance type.
public java.util.Collection getComponents()
Components from the parent container are placed before those from the child container.
getComponents in interface ComponentMap
public Dependency getDependencyOfType(java.lang.Class type,
ComponentMap cmap)
getDependencyOfType in interface ComponentMaptype - The component instance type.cmap - The ComponentMap object from which the parts of
the component should be obtained.
This parameter is typically passed as 'this' so that the parts are
created in the same container.
When implementing container interaction such as inheritance,
this parameter may be passed as a different ComponentMap object.
public Dependency getDependency(java.lang.Object key,
ComponentMap cmap)
getDependency in interface ComponentMapkey - The component key.cmap - The ComponentMap object from which the parts of
the component should be obtained.
This parameter is typically passed as 'this' so that the parts are
created in the same container.
When implementing container interaction such as inheritance,
this parameter may be passed as a different ComponentMap object.
public void verify(ComponentMap cmap)
verify in interface Registrarcmap - the ComponentMap from which
the parts of the registered components are obtained.public java.util.Set keys()
keys in interface ComponentMappublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||