Example usage for org.springframework.ide.eclipse.beans.core.internal.model BeansMapEntry getValue

List of usage examples for org.springframework.ide.eclipse.beans.core.internal.model BeansMapEntry getValue

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.beans.core.internal.model BeansMapEntry getValue.

Prototype

public Object getValue() 

Source Link

Usage

From source file:org.dozer.eclipse.plugin.sourcepage.util.DozerPluginUtils.java

public static String getClassNameForCCI(IFile mappingIFile, String customConverterId) {
    IBean bean = getDozerBeanForMappingFile(mappingIFile);

    if (bean == null)
        return null;

    BeansMapEntry beansMapEntry = getCCIModelElementForMappingFile(bean, customConverterId);

    if (beansMapEntry != null) {
        if (beansMapEntry.getValue() instanceof Bean) {
            Bean cciBean = (Bean) beansMapEntry.getValue();
            return cciBean.getBeanDefinition().getBeanClassName();
        } else if (beansMapEntry.getValue() instanceof BeanReference) {
            BeanReference beanRef = (BeanReference) beansMapEntry.getValue();
            String beanName = beanRef.getBeanName();

            Set<IBeansProject> projects = BeansCorePlugin.getModel().getProjects();
            for (IBeansProject beansProject : projects) {
                Set<IBeansConfig> tempConfigs = beansProject.getConfigs();
                for (IBeansConfig config : tempConfigs) {
                    IBean foundBean = config.getBean(beanName);
                    if (foundBean != null) {
                        return foundBean.getClassName();
                    }//w  w w.  j av a 2 s. c  o  m
                }
            }
        }
    }

    return null;
}