/** * Returns a component descriptor for a specified type id. * @param componentType the component type id * @return the component descriptor */ public ComponentDescriptor getComponentDescriptor (TypeID componentType) { assert isAccess () : "No Mutex acess"; //NOI18N if (componentType == null) return null; return descriptors.get (componentType); }
/** * Returns a list of all registered component producers. * @return the list of all registered component producers */ public List<ComponentProducer> getComponentProducers () { assert isAccess (); return Collections.unmodifiableList (producers); }
/** * Returns a collection of all registered component descriptors. * @return the collection of all registered component descriptors */ public Collection<ComponentDescriptor> getComponentDescriptors () { assert isAccess (); return Collections.unmodifiableCollection (descriptors.values ()); }
/** * Checks whether a component descriptor is compatible (descriptor analogy of instanceof operator) with a type id. * Means: Specified component descriptor or its super descriptor has the same type id as the specified one. * @param typeID the type id * @param componentDescriptor the component descriptor * @return true if compatible */ private boolean isComponentDescriptorCompatibleWithTypeID (TypeID typeID, ComponentDescriptor componentDescriptor) { assert isAccess (); if (typeID == null) return false; for (;;) { if (componentDescriptor == null) return false; TypeDescriptor typeDescriptor = componentDescriptor.getTypeDescriptor (); TypeID checked = typeDescriptor.getThisType (); if (checked == null) return false; if (checked.equals (typeID)) return true; componentDescriptor = getComponentDescriptor (typeDescriptor.getSuperType ()); } }