Package org.springframework.beans

Examples of org.springframework.beans.BeanWrapperImpl.convertIfNecessary()


          Object argValue = argsToResolve[i];
          if (argValue instanceof BeanMetadataElement) {
            String argName = "constructor argument with index " + i;
            argValue = valueResolver.resolveValueIfNecessary(argName, argValue);
          }
          argsToUse[i] = bw.convertIfNecessary(argValue, paramTypes[i],
              new MethodParameter(constructorToUse, i));
        }
      }
    }
View Full Code Here


            Object argValue = argsToResolve[i];
            if (argValue instanceof BeanMetadataElement) {
              String argName = "factory method argument with index " + i;
              argValue = valueResolver.resolveValueIfNecessary(argName, argValue);
            }
            argsToUse[i] = bw.convertIfNecessary(argValue, paramTypes[i],
                new MethodParameter(factoryMethodToUse, i));
          }
        }
      }
    }
View Full Code Here

            int i = beanPath.indexOf(".");
            String beanName = i<0?beanPath:beanPath.substring(0,i);
            Object namedBean = appCtx.getBean(beanName);
            BeanWrapperImpl bwrap = new BeanWrapperImpl(namedBean);
            String propPath = beanPath.substring(i+1);
            Object coercedVal = bwrap.convertIfNecessary(newVal, bwrap.getPropertyValue(propPath).getClass());
            bwrap.setPropertyValue(propPath, coercedVal);
        }
        Reference ref = getRequest().getResourceRef();
        ref.setPath(getBeansRefPath());
        ref.addSegment(beanPath);
View Full Code Here

                    editor = BeanUtils.findEditorByConvention(propertyType);
                }

                if (editor == null) {
                    if (propertyType.isArray() || CollectionFactory.isApproximableCollectionType(propertyType)) {
                        field.setValues((String[]) bean.convertIfNecessary(propertyValue, String[].class));
                    } else {
                        field.setValue(bean.convertIfNecessary(propertyValue, String.class));
                    }
                } else {
                    editor.setValue(propertyValue);
View Full Code Here

                if (editor == null) {
                    if (propertyType.isArray() || CollectionFactory.isApproximableCollectionType(propertyType)) {
                        field.setValues((String[]) bean.convertIfNecessary(propertyValue, String[].class));
                    } else {
                        field.setValue(bean.convertIfNecessary(propertyValue, String.class));
                    }
                } else {
                    editor.setValue(propertyValue);
                    field.setValue(editor.getAsText());
                }
View Full Code Here

                    editor = BeanUtils.findEditorByConvention(propertyType);
                }

                if (editor == null) {
                    if (propertyType.isArray() || CollectionFactory.isApproximableCollectionType(propertyType)) {
                        field.setValues((String[]) bean.convertIfNecessary(propertyValue, String[].class));
                    } else {
                        field.setValue(bean.convertIfNecessary(propertyValue, String.class));
                    }
                } else {
                    editor.setValue(propertyValue);
View Full Code Here

                if (editor == null) {
                    if (propertyType.isArray() || CollectionFactory.isApproximableCollectionType(propertyType)) {
                        field.setValues((String[]) bean.convertIfNecessary(propertyValue, String[].class));
                    } else {
                        field.setValue(bean.convertIfNecessary(propertyValue, String.class));
                    }
                } else {
                    editor.setValue(propertyValue);
                    field.setValue(editor.getAsText());
                }
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.