Uploaded image for project: 'Commons JXPath'
  1. Commons JXPath
  2. JXPATH-53

ConvertUtils instead of TypeUtils

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.1 Final
    • None
    • None
    • Operating System: other
      Platform: Other

    • 29857

    Description

      ConvertUtils from commons BeanUtils package should be used instead of TypeUtils
      for type conversions because it is more 'pluggable' (you can add/register any
      converter you want).

      Until it's changed, I'm using something like this (I'm not sure this is a good
      solution):

      TypeUtils.setTypeConverter(new TypeConverter() {
      public boolean canConvert(Object object, Class toType)

      { return ConvertUtils.lookup(toType) != null; }

      public Object convert(Object object, Class toType)

      { return ConvertUtils.convert(object.toString(), toType); }

      });

      Attachments

        Activity

          People

            Unassigned Unassigned
            xdury@hotmail.com Xavier Dury
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: