Skip to content

Java web templates: xylo.misc

Stefan Endrullis edited this page Sep 16, 2018 · 4 revisions

This file contains templates for miscellaneous use cases:

  • .new - create a new instance of a class
  • .val - extract the expression as value (similar to the .var template)
  • .orElse - Optional.ofNullable($expr$).orElse($value$)
  • .orElseGet - Optional.ofNullable($expr$).orElseGet($supplierF$)
  • .elvis - Elvis operator ($expr$ != null ? $expr$ : $END$)

String templates:

  • .r, .regEx - convert a String into a regular expression
  • .capitalize - capitalize first character
  • .uncapitalize - uncapitalize first character