Examples of IBeanProperty


Examples of org.springframework.ide.eclipse.beans.core.model.IBeanProperty

    //get first bean that uses our mapping file
    for (IBean bean : beans) {
      String className = BeansModelUtils.getBeanClass(bean, null);     
      if ("org.dozer.util.mapping.DozerBeanMapper".equals(className)) {
        //get mappingFiles-property
        IBeanProperty mappingFilesProperty = bean.getProperty("mappingFiles");
        if (mappingFilesProperty == null)
          continue;   
       
        BeansList mappingFilesPropertyValues = (BeansList)mappingFilesProperty.getValue();
        IModelElement[] modelElements = mappingFilesPropertyValues.getElementChildren();
 
        //find reference to our mapping file
        for (IModelElement modelElement : modelElements) {
          String configFilePath = ((BeansTypedString)modelElement).getString();
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeanProperty

  public static IModelElement[] getPossibleCCIMappingForMappingFile(IBean bean) {
    if (bean == null)
      return null;
   
    //get customConvertersWithId-property
    IBeanProperty ccwiProperty = bean.getProperty("customConvertersWithId");
   
    //no customConvertersWithId property, return at least the bean
    if (ccwiProperty == null)
      return null;
   
    BeansMap ccwiPropertyValues = (BeansMap)ccwiProperty.getValue();
    return ccwiPropertyValues.getElementChildren();
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeanProperty

      }
 
      // Retrieve this bean's properties
      properties = new LinkedHashMap<String, IBeanProperty>();
      for (PropertyValue propValue : definition.getPropertyValues().getPropertyValues()) {
        IBeanProperty property = new BeanProperty(this, propValue);
        properties.put(property.getElementName(), property);
      }
 
      // Retrieve this bean's method overrides
      if (definition instanceof AbstractBeanDefinition) {
        methodOverrides = new LinkedHashSet<IBeanMethodOverride>();
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeanProperty

  public Property[] getProperties() {
    ArrayList<Property> list = new ArrayList<Property>();
    Iterator props = bean.getProperties().iterator();
    while (props.hasNext()) {
      IBeanProperty prop = (IBeanProperty) props.next();
      list.add(new Property(this, prop));
    }
    props = BeansMetadataPlugin.getMetadataModel().getBeanProperties(bean).iterator();
    while (props.hasNext()) {
      IBeanProperty prop = (IBeanProperty) props.next();
      list.add(new Property(this, prop));
    }
    props = extendedProperties.iterator();
    while (props.hasNext()) {
      IBeanProperty prop = (IBeanProperty) props.next();
      list.add(new Property(this, prop));
    }
    return list.toArray(new Property[list.size()]);
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeanProperty

      addBeanReferencesForValue(carg, carg.getValue(), context, references, referencedBeans, recursive);
    }
    else if (element instanceof IBeanProperty) {

      // Add referenced beans from property element
      IBeanProperty property = (IBeanProperty) element;
      addBeanReferencesForValue(property, property.getValue(), context, references, referencedBeans, recursive);

    }
    else {
      throw new IllegalArgumentException("Unsupported model element " + element);
    }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeanProperty

            try {
              IJavaElement source = ((AutowireBeanReference) ref).getSource();
              if (source instanceof IField) {
                String propertyName = source.getElementName();
                if (!autowiredProperties.contains(propertyName)) {
                  IBeanProperty newProperty = new BeanProperty(entry.getKey(), new PropertyValue(
                      propertyName, new RuntimeBeanReference(ref.getBeanName())));
                  bean.addBeanProperty(newProperty);
                  autowiredProperties.add(propertyName);
                }

              }
              else if (source instanceof IMethod && ((IMethod) source).isConstructor()) {
                IBeanConstructorArgument newConstructorArg = new BeanConstructorArgument(
                    entry.getKey(), ((AutowireBeanReference) ref).getParameterIndex(),
                    new ValueHolder(new RuntimeBeanReference(ref.getBeanName())));
                bean.addBeanConstructorArgument(newConstructorArg);
              }
              else if (source instanceof IMethod && !((IMethod) source).isConstructor()) {
                String propertyName = source.getElementName();
                if (propertyName.startsWith("set")) {
                  propertyName = Introspector.decapitalize(propertyName.substring(3));
                }
                if (!autowiredProperties.contains(propertyName)) {
                  IBeanProperty newProperty = new BeanProperty(entry.getKey(), new PropertyValue(
                      propertyName, new RuntimeBeanReference(ref.getBeanName())));
                  bean.addBeanProperty(newProperty);
                  autowiredProperties.add(propertyName);
                }
              }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeanProperty

    for (Object child : super.getChildren(bean)) {

      if (child instanceof IBeanProperty) {

        IBeanProperty property = (IBeanProperty) child;
        if (!FILTER_PROPERTIES.contains(property.getElementName())) {
          filtered.add(property);
        }
      }
    }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.core.model.IBeanProperty

    IBean autoproxyBean = BeansModelUtils.getBean(AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME, beansConfig);
   
    if (autoproxyBean != null) {
      configuration.setAutoProxy(true);
     
      IBeanProperty targetProxyClassProperty = autoproxyBean.getProperty(PROXY_TARGET_CLASS);
      if (targetProxyClassProperty != null && targetProxyClassProperty.getValue() != null) {
        String value = ((BeansTypedString)targetProxyClassProperty.getValue()).getString();
        boolean proxyTargetClass = Boolean.valueOf(value).booleanValue();
        if (proxyTargetClass) {
          configuration.setProxyTargetClass(proxyTargetClass);
        }       
      }
     
      IBeanProperty includes = autoproxyBean.getProperty(INCLUDE_PATTERNS);
      if (includes != null && includes.getValue() != null) {
        List<Pattern> patterns = new ArrayList<Pattern>();
        BeansList includesList = (BeansList) includes.getValue();
        List<Object> includePatterns = includesList.getList();
        for (Object includePattern : includePatterns) {
          String pattern = ((BeansTypedString)includePattern).getString();
          if (StringUtils.hasText(pattern)) {
            patterns.add(Pattern.compile(pattern));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.