Class SplibThymeleafOptionUtil

java.lang.Object
jp.ecuacion.splib.web.util.SplibThymeleafOptionUtil

@Component("optUtil") public class SplibThymeleafOptionUtil extends Object
Analyzes options specified with html components.

It's called from thymeleaf.
Options are in the format of csv and able to receive multiple optional attributes. It's written like 'readonly,required'.
It also receives key value parameter like 'readonly,id=deptName,required'.

  • Constructor Details

    • SplibThymeleafOptionUtil

      public SplibThymeleafOptionUtil()
      Constructs a new instance.
  • Method Details

    • hasKey

      public boolean hasKey(String options, String key)
      Returns if specified key exists in options.
    • getValue

      public String getValue(String options, String key)
      Returns value obtained from the key.
      Parameters:
      options - options
      key - key
      Returns:
      value
    • getValueOrElse

      public String getValueOrElse(String options, String key, String defaultValue)
      Returns value obtained from the key, or defaultValue when the key does not exist in the properties file.
      Parameters:
      options - options
      key - key
      defaultValue - defaultValue
      Returns:
      value