Example usage for org.springframework.ide.eclipse.beans.core.namespaces IModelElementProvider getElement

List of usage examples for org.springframework.ide.eclipse.beans.core.namespaces IModelElementProvider getElement

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.beans.core.namespaces IModelElementProvider getElement.

Prototype

ISourceModelElement getElement(IBeansConfig config, ComponentDefinition definition);

Source Link

Document

Returns the corresponding ISourceModelElement for the given ComponentDefinition .

Usage

From source file:org.springframework.ide.eclipse.beans.core.internal.model.BeansJavaConfig.java

/**
 * Registers the given component definition with this {@link BeansConfig}'s beans and component storage.
 *//*from   w  w w. jav a 2  s.  com*/
private void registerComponentDefinition(ComponentDefinition componentDefinition,
        Map<String, IModelElementProvider> elementProviders) {
    String uri = NamespaceUtils.getNameSpaceURI(componentDefinition);
    IModelElementProvider provider = elementProviders.get(uri);
    if (provider == null) {
        provider = BeansConfig.DEFAULT_ELEMENT_PROVIDER;
    }
    ISourceModelElement element = provider.getElement(BeansJavaConfig.this, componentDefinition);
    if (element instanceof IBean) {
        beans.put(element.getElementName(), (IBean) element);
    } else if (element instanceof IBeansComponent) {
        components.add((IBeansComponent) element);
    }
}