Recupera um componente pelo seu ID, que por padrão
é nome canônico da classe do componente.
@param componentId ID do componenete.
@return Componente referente ao ID fornecido.
776025
public T get(String componentId) {
		for (T component : components) {
			if (component.getId().equals(componentId)) {
				return component;
			}
		}
		return null;
	}
486277
public Component remove (Class<? extends Component> componentClass) {
		ComponentType componentType = ComponentType.getFor(componentClass);
		int componentTypeIndex = componentType.getIndex();
		
		if(components.isIndexWithinBounds(componentTypeIndex)){
			Component removeComponent = components.get(componentTypeIndex);
	
			if (removeComponent != null && removeInternal(componentClass) != null) {
				if (componentOperationHandler != null) {
					componentOperationHandler.remove(this);
				}
				else {
					notifyComponentRemoved();
				}
			}
	
			return removeComponent;
		}
		
		return null;
	}
102306
protected void createComponent (
        int componentId, String cclass, String cname, FrameProvider fprov)
    {
        // look up the component class information
        ComponentClass clazz = _classes.get(cclass);
        if (clazz == null) {
            log.warning("Non-existent component class",
                "class", cclass, "name", cname, "id", componentId);
            return;
        }

        // create the component
        CharacterComponent component = new CharacterComponent(componentId, cname, clazz, fprov);

        // stick it into the appropriate tables
        _components.put(componentId, component);

        // we have a hash of lists for mapping components by class/name
        ArrayList<CharacterComponent> comps = _classComps.get(cclass);
        if (comps == null) {
            comps = Lists.newArrayList();
            _classComps.put(cclass, comps);
        }
        if (!comps.contains(component)) {
            comps.add(component);
        } else {
            log.info("Requested to register the same component twice?", "comp", component);
        }
    }
796559
function getComponent(tn) {
        var cid = tn.toLowerCase()
        var compDef
        components.some(function (comp) {
            if (comp.hasOwnProperty(cid)) {
                compDef = comp[cid]
                return true
            }
        })
        return compDef
    }
728026
def component(self, extra_params=None):
        
        if self.get('component_id', None):
            components = self.space.components(id=self['component_id'], extra_params=extra_params)
            if components:
                return components[0]
1343671
protected String getComponentModules(List<String> componentIds) {

        Set<String> comps = new HashSet<String>();
        List<CmsSetupComponent> components = CmsCollectionsGenericWrapper.list(m_components.elementList());
        for (CmsSetupComponent comp : components) {
            if (componentIds.contains(comp.getId())) {
                comps.addAll(getComponentModules(comp));
            }

        }

        StringBuffer buf = new StringBuffer();
        List<String> moduleNames = sortModules(getAvailableModules().values());
        boolean first = true;
        for (String moduleName : moduleNames) {
            if (!first) {
                buf.append("|");
            }
            if (comps.contains(moduleName)) {
                buf.append(moduleName);
            }
            first = false;
        }

        return buf.toString();
    }
301319
private function getManifestComponentModuleIndex($manifest, $componentId)
    {
        $manifest = is_array($manifest)
            ? $manifest
            : $this->getManifest($manifest);

        $modules = array_filter($manifest['modules'], function ($module) use ($componentId) {
            return ($module['id'] === $componentId);
        });

        return array_keys($modules)[0];
    }
841979
public static WComponent getComponentWithId(final WComponent root, final String id) {
		return getComponentWithId(root, id, false);
	}
672057
public static WComponent getComponentWithId(final WComponent root, final String id,
			final boolean visibleOnly) {
		ComponentWithContext comp = getComponentWithContextForId(root, id, visibleOnly);
		return comp == null ? null : comp.getComponent();
	}
395599
private String generateIncrementedId (String componentId) {
        Integer serialNum = (Integer) context.getAttributes().get(componentId);
        if (null == serialNum) {
            serialNum = 1;
        } else {
            serialNum = serialNum.intValue() + 1;
        }
        context.getAttributes().put(componentId, serialNum);
        componentId = componentId + UNIQUE_ID_PREFIX + serialNum.intValue();
        return componentId;
    }
676578
@Nullable
    public Container getContainerWithId(@Nonnull String id) {
        if (id == null || id.trim().length() == 0) {
            throw new IllegalArgumentException("A container ID must be provided.");
        }

        for (Container container : getContainers()) {
            if (container.getId().equals(id)) {
                return container;
            }
        }

        return null;
    }
385276
public Fields getComponentOutputFields(String componentId, String streamId) {
        Fields ret = _componentToStreamToFields.get(componentId).get(streamId);
        if (ret == null) {
            throw new IllegalArgumentException("No output fields defined for component:stream " + componentId + ":" + streamId);
        }
        return ret;
    }
323822
public function getDomainComponentId()
    {
        if (!isset($this->_domainComponentIdCache)) { //cache ist vorallem für bei kwfUnserialize nützlich
            $this->_domainComponentIdCache = $this->getDomainComponent()->componentId;
        }
        return $this->_domainComponentIdCache;
    }
588473
private function getComponent(string $id)
    {
        if (!isset($this->storage[$id])) {
            throw new \OutOfRangeException(sprintf('Component with ID "%s" not found.', $id));
        }
        if (\is_array($this->storage[$id])) {
            $component = $this->factory->build($this->getComponentConfig($id));
            $this->resolveComponentDependencies($id, $component);
            $this->storage[$id] = $component;
        }
        return $this->storage[$id];
    }
884869
def _fix_component_id(self, component):
        ''

        theID = getattr(component, "id", None)
        if theID is not None:
            setattr(component, "id", self._fix_id(theID))
        try:
            for c in component.children:
                self._fix_component_id(c)
        except: #pylint: disable=bare-except
            pass
697980
public List<Integer> getComponentTasks(String componentId) {
        List<Integer> ret = _componentToTasks.get(componentId);
        if (ret == null)
            return new ArrayList<>();
        else
            return new ArrayList<>(ret);
    }
73966
public function setComponentType(ComponentTypeInterface $componentType)
    {
        $this->componentTypeId = $componentType->getId();

        return parent::setComponentType($componentType);
    }