public interface Technology<Data>
Model)
and particular technology like knockout.js
in a browser window, etc.
Since introduction of technology identifiers one can choose between
different background implementations to handle the conversion and
communication requests. The currently known provider is
org.netbeans.html:ko4j module which registers
a knockout.js
implementation called ko4j.| Modifier and Type | Interface and Description |
|---|---|
static interface |
Technology.ApplyId<D>
Apply technology bindings at selected subtree of the HTML page.
|
static interface |
Technology.BatchInit<D>
For certain rendering technologies it may be more efficient to register
property and function bindings for one instance of the model at once,
rather then doing it incrementally via
expose(org.netbeans.html.json.spi.FunctionBinding, java.lang.Object, java.lang.Object)
and
bind(org.netbeans.html.json.spi.PropertyBinding, java.lang.Object, java.lang.Object). |
static interface |
Technology.ValueMutated<D>
Some technologies are more effective when number of calls between
Java and JavaScript is limited - to do that when a value of property
is changed they should implement this additional interface.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyBindings(Data data)
Applies given data to current context (usually an HTML page).
|
void |
bind(PropertyBinding b,
Object model,
Data data)
Binds a property between the model and the data as used by the technology.
|
void |
expose(FunctionBinding fb,
Object model,
Data d) |
void |
runSafe(Runnable r)
Deprecated.
Use
BrwsrCtx.execute(java.lang.Runnable) |
<M> M |
toModel(Class<M> modelClass,
Object data)
Converts an element potentially representing a model into the model.
|
void |
valueHasMutated(Data data,
String propertyName)
Model for given data has changed its value.
|
Object |
wrapArray(Object[] arr)
Some technologies may require wrapping a Java array into a special
object.
|
Data |
wrapModel(Object model)
Creates an object to wrap the provided model object.
|
Data wrapModel(Object model)
Model annotation.model - the model generated from Model<M> M toModel(Class<M> modelClass, Object data)
M - the type of the modelClassmodelClass - expected class to convert the data todata - the current data provided from the browsernullvoid bind(PropertyBinding b, Object model, Data data)
b - the description of the requested bindingmodel - the original instance of the modeldata - the data to bind with the modelvoid valueHasMutated(Data data, String propertyName)
data - technology's own representation of the modelpropertyName - name of the model property that changedvoid expose(FunctionBinding fb, Object model, Data d)
void applyBindings(Data data)
data - the data to applyObject wrapArray(Object[] arr)
arr - original array@Deprecated void runSafe(Runnable r)
BrwsrCtx.execute(java.lang.Runnable)r - the runnable to executeCopyright © 2015 NetBeans. All Rights Reserved.