Package org.springframework.beans

Examples of org.springframework.beans.PropertyValues


    this.filterConfig = filterConfig;

    // Set bean properties from init parameters.
    try {
      PropertyValues pvs = new FilterConfigPropertyValues(filterConfig, this.requiredProperties);
      BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this);
      ResourceLoader resourceLoader = new ServletContextResourceLoader(filterConfig.getServletContext());
      bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader));
      initBeanWrapper(bw);
      bw.setPropertyValues(pvs, true);
View Full Code Here


   * @param beanName the name of the bean
   * @param mbd the bean definition for the bean
   * @param bw BeanWrapper with bean instance
   */
  protected void populateBean(String beanName, RootBeanDefinition mbd, BeanWrapper bw) {
    PropertyValues pvs = mbd.getPropertyValues();

    if (bw == null) {
      if (!pvs.isEmpty()) {
        throw new BeanCreationException(beanName, "Cannot apply property values to null instance");
      }
      else {
        // Skip property population phase for null instance.
        return;
View Full Code Here

   * @return an array of bean property names
   * @see org.springframework.beans.BeanUtils#isSimpleProperty
   */
  protected String[] unsatisfiedNonSimpleProperties(RootBeanDefinition mbd, BeanWrapper bw) {
    Set result = new TreeSet();
    PropertyValues pvs = mbd.getPropertyValues();
    PropertyDescriptor[] pds = bw.getPropertyDescriptors();
    for (int i = 0; i < pds.length; i++) {
      if (pds[i].getWriteMethod() != null && !isExcludedFromDependencyCheck(pds[i]) &&
          !pvs.contains(pds[i].getName()) && !BeanUtils.isSimpleProperty(pds[i].getPropertyType())) {
        result.add(pds[i].getName());
      }
    }
    return StringUtils.toStringArray(result);
  }
View Full Code Here


  private void findInnerBeanDefinitionsAndBeanReferences(BeanDefinition beanDefinition) {
    List innerBeans = new ArrayList();
    List references = new ArrayList();
    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) {
View Full Code Here

      logger.info("Initializing portlet '" + getPortletName() + "'");
    }
   
    // Set bean properties from init parameters.
    try {
      PropertyValues pvs = new PortletConfigPropertyValues(getPortletConfig(), this.requiredProperties);
      BeanWrapper bw = new BeanWrapperImpl(this);
      ResourceLoader resourceLoader = new PortletContextResourceLoader(getPortletContext());
      bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader));
      initBeanWrapper(bw);
      bw.setPropertyValues(pvs, true);
View Full Code Here

    this.filterConfig = filterConfig;

    // Set bean properties from init parameters.
    try {
      PropertyValues pvs = new FilterConfigPropertyValues(filterConfig, this.requiredProperties);
      BeanWrapper bw = new BeanWrapperImpl(this);
      ResourceLoader resourceLoader = new ServletContextResourceLoader(filterConfig.getServletContext());
      bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader));
      initBeanWrapper(bw);
      bw.setPropertyValues(pvs, true);
View Full Code Here

      logger.debug("Initializing servlet '" + getServletName() + "'");
    }

    // Set bean properties from init parameters.
    try {
      PropertyValues pvs = new ServletConfigPropertyValues(getServletConfig(), this.requiredProperties);
      BeanWrapper bw = new BeanWrapperImpl(this);
      ResourceLoader resourceLoader = new ServletContextResourceLoader(getServletContext());
      bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader));
      initBeanWrapper(bw);
      bw.setPropertyValues(pvs, true);
View Full Code Here

      logger.info("Initializing portlet '" + getPortletName() + "'");
    }
   
    // Set bean properties from init parameters.
    try {
      PropertyValues pvs = new PortletConfigPropertyValues(getPortletConfig(), this.requiredProperties);
      BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this);
      ResourceLoader resourceLoader = new PortletContextResourceLoader(getPortletContext());
      bw.registerCustomEditor(Resource.class, new ResourceEditor(resourceLoader));
      initBeanWrapper(bw);
      bw.setPropertyValues(pvs, true);
View Full Code Here

   * @param beanName the name of the bean
   * @param mbd the bean definition for the bean
   * @param bw BeanWrapper with bean instance
   */
  protected void populateBean(String beanName, AbstractBeanDefinition mbd, BeanWrapper bw) {
    PropertyValues pvs = mbd.getPropertyValues();

    if (bw == null) {
      if (!pvs.isEmpty()) {
        throw new BeanCreationException(
            mbd.getResourceDescription(), beanName, "Cannot apply property values to null instance");
      }
      else {
        // Skip property population phase for null instance.
View Full Code Here

   * @return an array of bean property names
   * @see org.springframework.beans.BeanUtils#isSimpleProperty
   */
  protected String[] unsatisfiedNonSimpleProperties(AbstractBeanDefinition mbd, BeanWrapper bw) {
    Set result = new TreeSet();
    PropertyValues pvs = mbd.getPropertyValues();
    PropertyDescriptor[] pds = bw.getPropertyDescriptors();
    for (int i = 0; i < pds.length; i++) {
      if (pds[i].getWriteMethod() != null && !isExcludedFromDependencyCheck(pds[i]) &&
          !pvs.contains(pds[i].getName()) && !BeanUtils.isSimpleProperty(pds[i].getPropertyType())) {
        result.add(pds[i].getName());
      }
    }
    return StringUtils.toStringArray(result);
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.PropertyValues

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.