Spring Parser

  • 类全路径: org.springframework.format.Parser
  • 类作用: 字符串准换成 java 对象
  1. @FunctionalInterface
  2. public interface Parser<T> {
  3. /**
  4. * Parse a text String to produce a T.
  5. * 将字符串转换成对象
  6. * @param text the text string
  7. * @param locale the current user locale
  8. * @return an instance of T
  9. * @throws ParseException when a parse exception occurs in a java.text parsing library
  10. * @throws IllegalArgumentException when a parse exception occurs
  11. */
  12. T parse(String text, Locale locale) throws ParseException;
  13. }
  • 类图

Parser