Examples of convertIfNecessary()


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

      }
      if (autowiredBeanNames != null) {
        autowiredBeanNames.addAll(matchingBeans.keySet());
      }
      TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
      return converter.convertIfNecessary(matchingBeans.values(), type);
    }
    else if (Collection.class.isAssignableFrom(type) && type.isInterface()) {
      Class<?> elementType = descriptor.getCollectionType();
      if (elementType == null) {
        if (descriptor.isRequired()) {
View Full Code Here

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

      }
      if (autowiredBeanNames != null) {
        autowiredBeanNames.addAll(matchingBeans.keySet());
      }
      TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
      return converter.convertIfNecessary(matchingBeans.values(), type);
    }
    else if (Map.class.isAssignableFrom(type) && type.isInterface()) {
      Class<?> keyType = descriptor.getMapKeyType();
      if (keyType == null || !String.class.isAssignableFrom(keyType)) {
        if (descriptor.isRequired()) {
View Full Code Here

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

      if (value instanceof String) {
        String strVal = resolveEmbeddedValue((String) value);
        value = evaluateBeanDefinitionString(strVal, getMergedBeanDefinition(beanName));
      }
      TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
      return converter.convertIfNecessary(value, type);
    }

    if (type.isArray()) {
      Class componentType = type.getComponentType();
      Map<String, Object> matchingBeans = findAutowireCandidates(beanName, componentType, descriptor);
View Full Code Here

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

      }
      if (autowiredBeanNames != null) {
        autowiredBeanNames.addAll(matchingBeans.keySet());
      }
      TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
      return converter.convertIfNecessary(matchingBeans.values(), type);
    }
    else if (Collection.class.isAssignableFrom(type) && type.isInterface()) {
      Class elementType = descriptor.getCollectionType();
      if (elementType == null) {
        if (descriptor.isRequired()) {
View Full Code Here

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

      }
      if (autowiredBeanNames != null) {
        autowiredBeanNames.addAll(matchingBeans.keySet());
      }
      TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
      return converter.convertIfNecessary(matchingBeans.values(), type);
    }
    else if (Map.class.isAssignableFrom(type) && type.isInterface()) {
      Class keyType = descriptor.getMapKeyType();
      if (keyType == null || !String.class.isAssignableFrom(keyType)) {
        if (descriptor.isRequired()) {
View Full Code Here

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

            Object[] convertedArguments = new Object[argCount];
            boolean match = true;
            for (int j = 0; j < argCount && match; j++) {
              // Verify that the supplied argument is assignable to the method parameter.
              try {
                convertedArguments[j] = converter.convertIfNecessary(arguments[j], paramTypes[j]);
              }
              catch (TypeMismatchException ex) {
                // Ignore -> simply doesn't match.
                match = false;
              }
View Full Code Here

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

        String strVal = resolveEmbeddedValue((String) value);
        BeanDefinition bd = (beanName != null && containsBean(beanName) ? getMergedBeanDefinition(beanName) : null);
        value = evaluateBeanDefinitionString(strVal, bd);
      }
      TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
      return converter.convertIfNecessary(value, type);
    }

    if (type.isArray()) {
      Class componentType = type.getComponentType();
      Map<String, Object> matchingBeans = findAutowireCandidates(beanName, componentType, descriptor);
View Full Code Here

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

      }
      if (autowiredBeanNames != null) {
        autowiredBeanNames.addAll(matchingBeans.keySet());
      }
      TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
      return converter.convertIfNecessary(matchingBeans.values(), type);
    }
    else if (Collection.class.isAssignableFrom(type) && type.isInterface()) {
      Class elementType = descriptor.getCollectionType();
      if (elementType == null) {
        if (descriptor.isRequired()) {
View Full Code Here

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

      }
      if (autowiredBeanNames != null) {
        autowiredBeanNames.addAll(matchingBeans.keySet());
      }
      TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
      return converter.convertIfNecessary(matchingBeans.values(), type);
    }
    else if (Map.class.isAssignableFrom(type) && type.isInterface()) {
      Class keyType = descriptor.getMapKeyType();
      if (keyType == null || !String.class.isAssignableFrom(keyType)) {
        if (descriptor.isRequired()) {
View Full Code Here

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

          convertedValue = valueHolder.getConvertedValue();
          args.preparedArguments[paramIndex] = convertedValue;
        }
        else {
          try {
            convertedValue = converter.convertIfNecessary(originalValue, paramType,
                MethodParameter.forMethodOrConstructor(methodOrCtor, paramIndex));
            if (originalValue == sourceValue || sourceValue instanceof TypedStringValue) {
              // Either a converted value or still the original one: store converted value.
              sourceHolder.setConvertedValue(convertedValue);
              args.preparedArguments[paramIndex] = convertedValue;
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.