Custom type converter Convert, converter convert
// Specify a type converter (convert String to Date) ConvertUtils. register (new Converter () {@ Override public Object convert (Class clazz, Object value) {// convert string to date SimpleDateFormat format = new SimpleDateFormat ("yyyy-MM-dd"); Date parse = null; try {parse = format. parse (value. toString ();} catch (ParseException e) {e. printStackTrace () ;}return parse ;}, Date. class );
List the frequently used BeanUtils built-in converters.
- AbstractArrayConverter
- AbstractConverter
- ArrayConverter
- BigDecimalConverter
- BooleanArrayConverter
- BooleanConverter
- ByteArrayConverter
- ByteConverter
- CalendarConverter
- CharacterArrayConverter
- CharacterConverter
- ClassConverter
- ConverterFacade
- DateCOnverter
- DateTimeConverter
- DoubleConverter
- FloatArrayConverter
- FileConverter
- FloatConverter
- IntegerArrayConverter
- IntegerConverter
- LongConverter
- LondArrayCOnverter
- NumberConverter
- ShortArrayConverter
- ShortConverter
- SqlTimeConverter
- SqlTimestampConverter
- StringArrayConverter
- StringConverter
- URLConverter