java.lang.Object
jp.ecuacion.splib.web.util.SplibThymeleafOptionUtil
Analyzes options specified with html components.
It's called from thymeleaf.
Options are in the format of csv and receives multiple optional attributes.
It's written like 'readonly,required'.
It also receives key value parameter like 'readonly,a=b,required'.
-
Constructor Summary
ConstructorsConstructorDescriptionSplibThymeleafOptionUtil(jakarta.servlet.http.HttpServletRequest request) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptiongetDeleteConfirmMessage(String rootRecordName, String itemDisplayedOnDelete) Provides message string shown when the delete button pressed.getLinkUrl(String options) Returns linkUrl.Returns value obtained from the key.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.booleanReturns if specified key exists in options.booleanhasLinkUrl(String options) Returns whether the options contain linkUrl.booleanhasThSortable(String options) Returns whether the options contain thSortable.booleanReturns whether the options contain deleted.booleanisDisabled(String options) Returns whether the options contain disabled.booleanisForSwitch(String options) Returns whether the options contain forSwitch.booleanisReadOnly(String options) Returns whether the options contain readonly.booleanneedsEmptyOption(String options) Returns whether the options contain noEmptyOption.booleanneedsOnclickJs(String options) Returns whether the options contain onClickJs.
-
Constructor Details
-
SplibThymeleafOptionUtil
public SplibThymeleafOptionUtil(jakarta.servlet.http.HttpServletRequest request) Constructs a new instance.- Parameters:
request- request
-
-
Method Details
-
getDeleteConfirmMessage
Provides message string shown when the delete button pressed.itemDisplayedOnDeleteには、通常は一つのitemを指定するが、"itemA,itemB"のように複数の項目を指定することも可能。 (natural keyが複数の項目からなる場合に使用) その場合は、(itemA, itemB) : (1, 2) のように括弧で括った形で表現
-
hasKey
Returns if specified key exists in options. -
getValue
Returns value obtained from the key.- Parameters:
options- optionskey- key- Returns:
- value
-
getValueOrElse
Returns value obtained from the key, or defaultValue when the key does not exist in the properties file.- Parameters:
options- optionskey- keydefaultValue- defaultValue- Returns:
- value
-
isReadOnly
Returns whether the options contain readonly.- Parameters:
options- options- Returns:
- boolean
-
isDisabled
Returns whether the options contain disabled.- Parameters:
options- options- Returns:
- boolean
-
isDeleted
Returns whether the options contain deleted.- Parameters:
options- options- Returns:
- boolean
-
isForSwitch
Returns whether the options contain forSwitch.- Parameters:
options- options- Returns:
- boolean
-
needsEmptyOption
Returns whether the options contain noEmptyOption.- Parameters:
options- options- Returns:
- boolean
-
needsOnclickJs
Returns whether the options contain onClickJs.- Parameters:
options- options- Returns:
- boolean
-
hasLinkUrl
Returns whether the options contain linkUrl.- Parameters:
options- options- Returns:
- boolean
-
getLinkUrl
Returns linkUrl.- Parameters:
options- options- Returns:
- linkUrl
-
hasThSortable
Returns whether the options contain thSortable.- Parameters:
options- options- Returns:
- boolean
-