Examples of convertIfNecessary()


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

      else if (argValue instanceof String) {
        argValue = this.beanFactory.evaluateBeanDefinitionString((String) argValue, mbd);
      }
      Class<?> paramType = paramTypes[argIndex];
      try {
        resolvedArgs[argIndex] = converter.convertIfNecessary(argValue, paramType, methodParam);
      }
      catch (TypeMismatchException ex) {
        String methodType = (methodOrCtor instanceof Constructor ? "constructor" : "factory method");
        throw new UnsatisfiedDependencyException(
            mbd.getResourceDescription(), beanName, argIndex, paramType,
View Full Code Here

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

      valueType = GenericCollectionTypeResolver.getCollectionType(this.targetSetClass);
    }
    if (valueType != null) {
      TypeConverter converter = getBeanTypeConverter();
      for (Object elem : this.sourceSet) {
        result.add(converter.convertIfNecessary(elem, valueType));
      }
    }
    else {
      result.addAll(this.sourceSet);
    }
View Full Code Here

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

      valueType = GenericCollectionTypeResolver.getCollectionType(this.targetListClass);
    }
    if (valueType != null) {
      TypeConverter converter = getBeanTypeConverter();
      for (Object elem : this.sourceList) {
        result.add(converter.convertIfNecessary(elem, valueType));
      }
    }
    else {
      result.addAll(this.sourceList);
    }
View Full Code Here

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

      valueType = GenericCollectionTypeResolver.getMapValueType(this.targetMapClass);
    }
    if (keyType != null || valueType != null) {
      TypeConverter converter = getBeanTypeConverter();
      for (Map.Entry entry : this.sourceMap.entrySet()) {
        Object convertedKey = converter.convertIfNecessary(entry.getKey(), keyType);
        Object convertedValue = converter.convertIfNecessary(entry.getValue(), valueType);
        result.put(convertedKey, convertedValue);
      }
    }
    else {
View Full Code Here

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

    }
    if (keyType != null || valueType != null) {
      TypeConverter converter = getBeanTypeConverter();
      for (Map.Entry entry : this.sourceMap.entrySet()) {
        Object convertedKey = converter.convertIfNecessary(entry.getKey(), keyType);
        Object convertedValue = converter.convertIfNecessary(entry.getValue(), valueType);
        result.put(convertedKey, convertedValue);
      }
    }
    else {
      result.putAll(this.sourceMap);
View Full Code Here

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

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

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

      valueType = GenericCollectionTypeResolver.getCollectionType(this.targetSetClass);
    }
    if (valueType != null) {
      TypeConverter converter = getBeanTypeConverter();
      for (Iterator it = this.sourceSet.iterator(); it.hasNext();) {
        result.add(converter.convertIfNecessary(it.next(), valueType));
      }
    }
    else {
      result.addAll(this.sourceSet);
    }
View Full Code Here

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

    }
    if (keyType != null || valueType != null) {
      TypeConverter converter = getBeanTypeConverter();
      for (Iterator it = this.sourceMap.entrySet().iterator(); it.hasNext();) {
        Map.Entry entry = (Map.Entry) it.next();
        Object convertedKey = converter.convertIfNecessary(entry.getKey(), keyType);
        Object convertedValue = converter.convertIfNecessary(entry.getValue(), valueType);
        result.put(convertedKey, convertedValue);
      }
    }
    else {
View Full Code Here

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

    if (keyType != null || valueType != null) {
      TypeConverter converter = getBeanTypeConverter();
      for (Iterator it = this.sourceMap.entrySet().iterator(); it.hasNext();) {
        Map.Entry entry = (Map.Entry) it.next();
        Object convertedKey = converter.convertIfNecessary(entry.getKey(), keyType);
        Object convertedValue = converter.convertIfNecessary(entry.getValue(), valueType);
        result.put(convertedKey, convertedValue);
      }
    }
    else {
      result.putAll(this.sourceMap);
View Full Code Here

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

              argValue = resolveAutowiredArgument(methodParam, beanName, null, converter);
            }
            else if (argValue instanceof BeanMetadataElement) {
              argValue = valueResolver.resolveValueIfNecessary("constructor argument", argValue);
            }
            argsToUse[i] = converter.convertIfNecessary(argValue, paramTypes[i], methodParam);
          }
        }
      }
    }
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.