Package org.springframework.beans

Examples of org.springframework.beans.PropertyValue


    BeanDefinition bd = factory.getBeanDefinition(beanName);
    while (bd.getOriginatingBeanDefinition() != null) {
      bd = bd.getOriginatingBeanDefinition();
    }
    PropertyValue pv = new PropertyValue(property, value);
    pv.setOptional(this.ignoreInvalidKeys);
    bd.getPropertyValues().addPropertyValue(pv);
  }
View Full Code Here


      if (bd.getPropertyValues().contains(propertyName)) {
        error("Multiple 'property' definitions for property '" + propertyName + "'", ele);
        return;
      }
      Object val = parsePropertyValue(ele, bd, propertyName);
      PropertyValue pv = new PropertyValue(propertyName, val);
      parseMetaElements(ele, pv);
      pv.setSource(extractSource(ele));
      bd.getPropertyValues().addPropertyValue(pv);
    }
    finally {
      this.parseState.pop();
    }
View Full Code Here

  private void findInnerBeanDefinitionsAndBeanReferences(BeanDefinition beanDefinition) {
    List<BeanDefinition> innerBeans = new ArrayList<BeanDefinition>();
    List<BeanReference> references = new ArrayList<BeanReference>();
    PropertyValues propertyValues = beanDefinition.getPropertyValues();
    for (int i = 0; i < propertyValues.getPropertyValues().length; i++) {
      PropertyValue propertyValue = propertyValues.getPropertyValues()[i];
      Object value = propertyValue.getValue();
      if (value instanceof BeanDefinitionHolder) {
        innerBeans.add(((BeanDefinitionHolder) value).getBeanDefinition());
      }
      else if (value instanceof BeanDefinition) {
        innerBeans.add((BeanDefinition) value);
View Full Code Here

      if (bd.getPropertyValues().contains(propertyName)) {
        error("Multiple 'property' definitions for property '" + propertyName + "'", ele);
        return;
      }
      Object val = parsePropertyValue(ele, bd, propertyName);
      PropertyValue pv = new PropertyValue(propertyName, val);
      parseMetaElements(ele, pv);
      pv.setSource(extractSource(ele));
      bd.getPropertyValues().addPropertyValue(pv);
    }
    finally {
      this.parseState.pop();
    }
View Full Code Here

      Enumeration en = config.getInitParameterNames();
      while (en.hasMoreElements()) {
        String property = (String) en.nextElement();
        Object value = config.getInitParameter(property);
        addPropertyValue(new PropertyValue(property, value));
        if (missingProps != null) {
          missingProps.remove(property);
        }
      }
View Full Code Here

      if (bd.getPropertyValues().contains(propertyName)) {
        error("Multiple 'property' definitions for property '" + propertyName + "'", ele);
        return;
      }
      Object val = parsePropertyValue(ele, bd, propertyName);
      PropertyValue pv = new PropertyValue(propertyName, val);
      parseMetaElements(ele, pv);
      pv.setSource(extractSource(ele));
      bd.getPropertyValues().addPropertyValue(pv);
    }
    finally {
      this.parseState.pop();
    }
View Full Code Here

          pv.setConvertedValue(convertedValue);
          deepCopy.add(pv);
        }
        else {
          resolveNecessary = true;
          deepCopy.add(new PropertyValue(pv, convertedValue));
        }
      }
    }
    if (mpvs != null && !resolveNecessary) {
      mpvs.setConverted();
View Full Code Here

      for (PropertyValue pv : pvs) {
        String canonicalName = PropertyAccessorUtils.canonicalPropertyName(pv.getName());
        propertyValues.put(canonicalName, pv);
      }
      for (String field : requiredFields) {
        PropertyValue pv = propertyValues.get(field);
        boolean empty = (pv == null || pv.getValue() == null);
        if (!empty) {
          if (pv.getValue() instanceof String) {
            empty = !StringUtils.hasText((String) pv.getValue());
          }
          else if (pv.getValue() instanceof String[]) {
            String[] values = (String[]) pv.getValue();
            empty = (values.length == 0 || !StringUtils.hasText(values[0]));
          }
        }
        if (empty) {
          // Use bind error processor to create FieldError.
View Full Code Here

      Enumeration en = config.getInitParameterNames();
      while (en.hasMoreElements()) {
        String property = (String) en.nextElement();
        Object value = config.getInitParameter(property);
        addPropertyValue(new PropertyValue(property, value));
        if (missingProps != null) {
          missingProps.remove(property);
        }
      }
View Full Code Here

      for (PropertyValue pv : pvs) {
        String canonicalName = PropertyAccessorUtils.canonicalPropertyName(pv.getName());
        propertyValues.put(canonicalName, pv);
      }
      for (String field : requiredFields) {
        PropertyValue pv = propertyValues.get(field);
        boolean empty = (pv == null || pv.getValue() == null);
        if (!empty) {
          if (pv.getValue() instanceof String) {
            empty = !StringUtils.hasText((String) pv.getValue());
          }
          else if (pv.getValue() instanceof String[]) {
            String[] values = (String[]) pv.getValue();
            empty = (values.length == 0 || !StringUtils.hasText(values[0]));
          }
        }
        if (empty) {
          // Use bind error processor to create FieldError.
View Full Code Here

TOP

Related Classes of org.springframework.beans.PropertyValue

Copyright © 2018 www.massapicom. 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.