Interface JsMethodArgumentsBuilder


public interface JsMethodArgumentsBuilder
Builder for specifying argument in Javascript method. Builder automatically escapes special characters in method arguments. Escaping consists from two steps. 1. Escape Javascript special characters in string arguments. 2. Escape HTML special characters for attributes.
Since:
3.10.0
  • Method Details

    • escapeForAttribute

      @NotNull JsMethodArgumentsBuilder escapeForAttribute(boolean escapeForAttribute)
      Configures whether arguments should be escaped for html attribute by this builder. true by default.
      Parameters:
      escapeForAttribute - flag that switches escaping
      Returns:
      current builder
      Since:
      3.10.2
    • string

      @NotNull JsMethodArgumentsBuilder string(@Nullable String value)
      Adds string argument to arguments list
      Parameters:
      value - nullable string value
      Returns:
      current builder
    • number

      @NotNull JsMethodArgumentsBuilder number(@Nullable Number value)
      Adds number argument to arguments list
      Parameters:
      value - nullable number value
      Returns:
      current builder
    • bool

      @NotNull JsMethodArgumentsBuilder bool(boolean value)
      Adds boolean argument to arguments list
      Parameters:
      value - boolean value
      Returns:
      current builder
    • js

      @NotNull JsMethodArgumentsBuilder js(@Nullable String rawJsString)
      Adds raw Javascript expression as argument to arguments list. Method user is responsible for correct encoding of that Javascript expression.
      Parameters:
      rawJsString - raw Javascript expression
      Returns:
      current builder
    • nullValue

      @NotNull JsMethodArgumentsBuilder nullValue()
      Adds null argument to arguments list
      Returns:
      current builder