列表

  • #lists: 用于列表的实用方法。
  1. /*
  2. * ======================================================================
  3. * See javadoc API for class org.thymeleaf.expression.Lists
  4. * ======================================================================
  5. */
  6. /*
  7. * Converts to list
  8. */
  9. ${#lists.toList(object)}
  10. /*
  11. * Compute size
  12. */
  13. ${#lists.size(list)}
  14. /*
  15. * Check whether list is empty
  16. */
  17. ${#lists.isEmpty(list)}
  18. /*
  19. * Check if element or elements are contained in list
  20. */
  21. ${#lists.contains(list, element)}
  22. ${#lists.containsAll(list, elements)}
  23. /*
  24. * Sort a copy of the given list. The members of the list must implement
  25. * comparable or you must define a comparator.
  26. */
  27. ${#lists.sort(list)}
  28. ${#lists.sort(list, comparator)}