Example usage for org.springframework.ide.eclipse.beans.core.model IBean getClassName

List of usage examples for org.springframework.ide.eclipse.beans.core.model IBean getClassName

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.beans.core.model IBean getClassName.

Prototype

String getClassName();

Source Link

Usage

From source file:org.synyx.hades.eclipse.HadesUtils.java

/**
 * Returns, whether the given bean is a Hades factory bean.
 * /*from  w ww  .j  a va 2  s .  c  o m*/
 * @param bean
 * @return
 */
public static boolean isHadesDaoBean(IBean bean) {

    return getFactoryName().equals(bean.getClassName());
}

From source file:org.synyx.hades.eclipse.HadesUtils.java

/**
 * Returns a one line {@link String} of the given bean in the format of
 * {@code $ beanId} [${daoInterface}]}.//w  w w.j  a  v a 2 s.  c o m
 * 
 * @param bean
 * @return
 */
public static String asText(IBean bean) {

    String typeName = isHadesDaoBean(bean) ? getDaoInterfaceName(bean) : bean.getClassName();

    return String.format("%s [%s]", bean.getElementName(), typeName);
}

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();
                    }/*from w  w w  . j a va2 s  .c  o  m*/
                }
            }
        }
    }

    return null;
}