public interface Transfer
service provider interface
responsible for
conversion of JSON objects to Java ones and vice-versa.
Since introduction of technology identifiers
one can choose between
different background implementations to handle the conversion and
communication requests. The known providers include
org.netbeans.html:ko4j
module which registers
a native browser implementation called xhr, and a
org.netbeans.html:ko-ws-tyrus
module which registers
Java based implementation named tyrus.Modifier and Type | Method and Description |
---|---|
void |
extract(Object obj,
String[] props,
Object[] values)
Called to inspect properties of an object (usually a JSON or JavaScript
wrapper).
|
void |
loadJSON(JSONCall call)
Starts the JSON or JSONP query.
|
Object |
toJSON(InputStream is)
Reads content of a stream and creates its JSON representation.
|
void extract(Object obj, String[] props, Object[] values)
obj
- the object to inspectprops
- the names of properties to check on the object
obj
values
- array of the same length as props
should be
filled by values of properties on the obj
. If a property is
not defined, a null
value should be stored in the arrayObject toJSON(InputStream is) throws IOException
extract
method. If the stream contains representation or a JSON array,
an Object[] should be returned - each of its members should, by itself
be acceptable argument to
the extract
method.is
- input stream to read data fromIOException
- if something goes wrongvoid loadJSON(JSONCall call)
call
- description of the call to makeCopyright © 2018 NetBeans. All rights reserved.