Package org.springframework.beans

Examples of org.springframework.beans.SimpleTypeConverter


    if (idEditor != null) {
      idEditor.setAsText(idAsString);
      return (ID) idEditor.getValue();
    }

    return new SimpleTypeConverter().convertIfNecessary(idAsString, idClass);
  }
View Full Code Here


        if ((callParameters != null) && (mBeanParameterInfos != null) && (realCount > 0)) {
            parameterArray = new Object[realCount];
            signatureArray = new String[realCount];

            SimpleTypeConverter typeConverter = new SimpleTypeConverter();

            for (int i = 0; i < realCount; i++) {
                String value = callParameters.get(i);

                String requiredType = mBeanParameterInfos[i].getType();
                Class<?> requiredClass = ClassUtils.forName(requiredType, this.getClass().getClassLoader());

                parameterArray[i] = typeConverter.convertIfNecessary(value, requiredClass);
                signatureArray[i] = requiredType;
            }
        }

        // Make call
View Full Code Here

   * The default implementation builds a
   * {@link org.springframework.beans.SimpleTypeConverter}.
   * Can be overridden in subclasses.
   */
  protected TypeConverter getDefaultTypeConverter() {
    return new SimpleTypeConverter();
  }
View Full Code Here

              Object elementValue = getResourceObject(context, resList.getResourceName()
                      + PREFIX_SEPARATOR + ResourceList.ELEMENT_KEY + "[" + i + "]");
              elements.add(elementValue);
            }

            SimpleTypeConverter converter = new SimpleTypeConverter();
            value = converter.convertIfNecessary(elements, field.getType());
          }
         
          try {
            field.set(object, value);
          } catch (IllegalAccessException e) {
View Full Code Here

            && value.getClass().getComponentType().getName().equals("float")) {
      value = ArrayUtils.toObject((float[]) value);
    } else {
      try {
        if (param.getType().equals(ConfigurationParameter.TYPE_STRING)) {
          SimpleTypeConverter converter = new SimpleTypeConverter();
          PropertyEditorUtil.registerUimaFITEditors(converter);
          if (value.getClass().isArray() || value instanceof Collection) {
            value = converter.convertIfNecessary(value, String[].class);
          } else {
            value = converter.convertIfNecessary(value, String.class);
          }
        }
      } catch (TypeMismatchException e) {
        throw new IllegalArgumentException(e.getMessage(), e);
      }
View Full Code Here

    if (customConverter != null) {
      return customConverter;
    }
    else {
      // Build default TypeConverter, registering custom editors.
      SimpleTypeConverter typeConverter = new SimpleTypeConverter();
      registerCustomEditors(typeConverter);
      return typeConverter;
    }
  }
View Full Code Here

   */
  private static SimpleTypeConverter getTypeConverter() {
    // TODO - This seems really expensive because we do this each time we invoke
    // getAsText(Object object, String path, String pattern). We should look at how Spring
    // optimizes around this.
    SimpleTypeConverter simpleTypeConverter = new SimpleTypeConverter();
    registerSkywayCustomEditors(simpleTypeConverter);
    return simpleTypeConverter;
  }
View Full Code Here

    BeanFactory beanFactory = getBeanFactory();
    if (beanFactory instanceof ConfigurableBeanFactory) {
      return ((ConfigurableBeanFactory) beanFactory).getTypeConverter();
    }
    else {
      return new SimpleTypeConverter();
    }
  }
View Full Code Here

   */
  protected boolean checkQualifiers(BeanDefinitionHolder bdHolder, Annotation[] annotationsToSearch) {
    if (ObjectUtils.isEmpty(annotationsToSearch)) {
      return true;
    }
    SimpleTypeConverter typeConverter = new SimpleTypeConverter();
    for (Annotation annotation : annotationsToSearch) {
      Class<? extends Annotation> type = annotation.annotationType();
      boolean checkMeta = true;
      boolean fallbackToMeta = false;
      if (isQualifier(type)) {
View Full Code Here

    if (customConverter != null) {
      return customConverter;
    }
    else {
      // Build default TypeConverter, registering custom editors.
      SimpleTypeConverter typeConverter = new SimpleTypeConverter();
      typeConverter.setConversionService(getConversionService());
      registerCustomEditors(typeConverter);
      return typeConverter;
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.SimpleTypeConverter

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.