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 Summary
Modifier and TypeMethodDescriptionbool
(boolean value) Adds boolean argument to arguments listescapeForAttribute
(boolean escapeForAttribute) Configures whether arguments should be escaped for html attribute by this builder.Adds raw Javascript expression as argument to arguments list.Adds null argument to arguments listAdds number argument to arguments listAdds string argument to arguments list
-
Method Details
-
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
Adds string argument to arguments list- Parameters:
value
- nullable string value- Returns:
- current builder
-
number
Adds number argument to arguments list- Parameters:
value
- nullable number value- Returns:
- current builder
-
bool
Adds boolean argument to arguments list- Parameters:
value
- boolean value- Returns:
- current builder
-
js
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
Adds null argument to arguments list- Returns:
- current builder
-