1.1 --- a/ko4j/src/main/java/org/netbeans/html/ko4j/KO4J.java Thu Jan 09 15:43:04 2014 +0100
1.2 +++ b/ko4j/src/main/java/org/netbeans/html/ko4j/KO4J.java Thu Jan 09 20:39:23 2014 +0100
1.3 @@ -84,34 +84,31 @@
1.4 return getKO();
1.5 }
1.6
1.7 - /** Java based implementation of transfer interface. Requires
1.8 - * org.json libraries on classpath. Use: <pre>
1.9 -<dependency>
1.10 - <groupId>de.twentyeleven.skysail</groupId>
1.11 - <artifactId>org.json-osgi</artifactId>
1.12 -</dependency>
1.13 - * </pre>
1.14 - * @return instance of the technology or <code>null</code>,
1.15 - * if <code>org.json</code> interfaces are not around
1.16 + /** Browser based implementation of transfer interface. Uses
1.17 + * browser method to convert string to JSON.
1.18 + *
1.19 + * @return non-null instance
1.20 */
1.21 - public Transfer transferViaOrgJSON() {
1.22 + public Transfer transfer() {
1.23 return getKO();
1.24 }
1.25
1.26 /** Returns browser based implementation of websocket transfer.
1.27 + * If available (for example JavaFX WebView on JDK7 does not have
1.28 + * this implementation).
1.29 *
1.30 * @return an instance or <code>null</code>, if there is no
1.31 * <code>WebSocket</code> object in the browser
1.32 */
1.33 - public WSTransfer<?> websocketsViaBrowser() {
1.34 + public WSTransfer<?> websockets() {
1.35 return getKO().areWebSocketsSupported() ? getKO() : null;
1.36 }
1.37
1.38 /** Registers technologies at position 100:
1.39 * <ul>
1.40 * <li>{@link #knockout()}</li>
1.41 - * <li>{@link #transferViaOrgJSON()} - if <code>org.json</code> libraries are around</li>
1.42 - * <li>{@link #websocketsViaBrowser()()} - if browser supports web sockets</li>
1.43 + * <li>{@link #transfer()}</li>
1.44 + * <li>{@link #websockets()()} - if browser supports web sockets</li>
1.45 * </ul>
1.46 * @param context the context to register to
1.47 * @param requestor the class requesting the registration
1.48 @@ -120,9 +117,9 @@
1.49 public void fillContext(Contexts.Builder context, Class<?> requestor) {
1.50 if (FXContext.isJavaScriptEnabled()) {
1.51 context.register(Technology.class, knockout(), 100);
1.52 - context.register(Transfer.class, transferViaOrgJSON(), 100);
1.53 + context.register(Transfer.class, transfer(), 100);
1.54 if (c.areWebSocketsSupported()) {
1.55 - context.register(WSTransfer.class, websocketsViaBrowser(), 100);
1.56 + context.register(WSTransfer.class, websockets(), 100);
1.57 }
1.58 }
1.59 }