Errai 3.0.1-SNAPSHOT

org.jboss.errai.marshalling.client.protocols
Class ErraiProtocol

java.lang.Object
  extended by org.jboss.errai.marshalling.client.protocols.ErraiProtocol
Direct Known Subclasses:
ErraiProtocolServer

public class ErraiProtocol
extends Object

A simple convenience class for the client and server bus' to use to encode/decode wire messages.

Author:
Mike Brock

Constructor Summary
ErraiProtocol()
           
 
Method Summary
static Map<String,Object> decodePayload(EJValue value)
          Decode a standard Errai Protocol payload to a Map of key value pairs.
static String encodePayload(Map<String,Object> message)
          Encode a standard Errai Protocol payload of the key-value pairs to be sent across the wire.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErraiProtocol

public ErraiProtocol()
Method Detail

encodePayload

public static String encodePayload(Map<String,Object> message)
Encode a standard Errai Protocol payload of the key-value pairs to be sent across the wire.

Parameters:
message - A map of the key-value pairs to be encoded.
Returns:
The encoded JSON

decodePayload

public static Map<String,Object> decodePayload(EJValue value)
Decode a standard Errai Protocol payload to a Map of key value pairs.

Parameters:
value - The root JSON element to start parsing from.
Returns:
The decoded Map.

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.