Package org.springframework.expression

Examples of org.springframework.expression.TypeConverter


   * @param value typed value to be converted
   * @param state expression state
   * @return {@code TypedValue} instance converted to {@code String}
   */
  private static String convertTypedValueToString(TypedValue value, ExpressionState state) {
    TypeConverter typeConverter = state.getEvaluationContext().getTypeConverter();
    TypeDescriptor typeDescriptor = TypeDescriptor.valueOf(String.class);
    if (typeConverter.canConvert(value.getTypeDescriptor(), typeDescriptor)) {
      return String.valueOf(typeConverter.convertValue(value.getValue(),
          value.getTypeDescriptor(), typeDescriptor));
    }
    return String.valueOf(value.getValue());
  }
View Full Code Here


  @Override
  public ConstructorExecutor resolve(EvaluationContext context, String typeName, List<TypeDescriptor> argumentTypes)
      throws AccessException {

    try {
      TypeConverter typeConverter = context.getTypeConverter();
      Class<?> type = context.getTypeLocator().findType(typeName);
      Constructor<?>[] ctors = type.getConstructors();

      Arrays.sort(ctors, new Comparator<Constructor<?>>() {
        @Override
View Full Code Here

TOP

Related Classes of org.springframework.expression.TypeConverter

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.