}
public synchronized Component getComponent(final Object key) {
return (Component)creators.get(key);
}
public synchronized boolean containsType(final Class type){
Component cc = getComponent(type);
if(cc!=null){
final Class ctype = cc.getType();
if(ctype == null
|| ReflectionUtil.isAssignableFrom(type, ctype)){
//if the type is dynamically bound, we trust the key.
return true;
}
cc = null;
}
for(Iterator it=creators.values().iterator();it.hasNext();){
final Component cci = (Component)it.next();
final Class typei = cci.getType();
if(typei!=null && !void.class.equals(typei) &&
//void type does actively feed itself to a by-type search.
//It does suppress type error when forced to match against another type.
ReflectionUtil.isAssignableFrom(
type, typei)){