public final class Bindings extends Object
ko.applyBindings
parameter.
Register as BindingsProvider
. When called build description of JSON
types using methods like Bindings.stringProperty(java.lang.String, boolean)
and then pass the result into
Response#applyBindings(org.netbeans.spi.knockout.Bindings)
method.Modifier and Type | Method and Description |
---|---|
Bindings |
booleanProperty(String name,
boolean array)
Generates a boolean property (with value
true ) into the JSON
class. |
static Bindings |
create(String name)
Defines new variable with provided name and assigns a JSON object into
it.
|
Bindings |
doubleProperty(String name,
boolean array)
Generates a floating point property (with value
0.1 ) into
the JSON class. |
static String |
findBindings(FileObject htmlFile,
int versionOfFormat)
Queries registered providers for additional knockout.js bindings for
given file.
|
Bindings |
function(String name)
Generates a function (empty) into the JSON class.
|
Bindings |
intProperty(String name,
boolean array)
Generates a integer property (with value
0 ) into the JSON
class. |
Bindings |
modelProperty(String name,
Bindings binding,
boolean array)
Generates complex subtype based on another
Bindings class. |
Bindings |
stringProperty(String name,
boolean array)
Generates a string property (with value
'' ) into the JSON
class. |
public static Bindings create(String name)
Bindings.intProperty(java.lang.String, boolean)
.name
- name of variable (must be valid JavaScript identifier)Bindings.doubleProperty(java.lang.String, boolean)
, and other methodspublic final Bindings booleanProperty(String name, boolean array)
true
) into the JSON
class.name
- name of variable (must be valid JavaScript identifier)array
- should this property be an array of just a single valuepublic final Bindings stringProperty(String name, boolean array)
''
) into the JSON
class.name
- name of variable (must be valid JavaScript identifier)array
- should this property be an array of just a single valuepublic final Bindings intProperty(String name, boolean array)
0
) into the JSON
class.name
- name of variable (must be valid JavaScript identifier)array
- should this property be an array of just a single valuepublic final Bindings doubleProperty(String name, boolean array)
0.1
) into
the JSON class.name
- name of variable (must be valid JavaScript identifier)array
- should this property be an array of just a single valuepublic final Bindings function(String name)
name
- name of variable (must be valid JavaScript identifier)public final Bindings modelProperty(String name, Bindings binding, boolean array)
Bindings
class.name
- name of variable (must be valid JavaScript identifier)binding
- another description of a JSON like objectarray
- should this property be an array of just a single valuepublic static String findBindings(FileObject htmlFile, int versionOfFormat)
htmlFile
- the HTML file opened in editorversionOfFormat
- the format of the output. Use 1
for
now.null
if no provider or format has been found
for given file or a JavaScript code formated accordingly