Unmarshalls the given {@link JsonNode} into the appropriate sub type based on the {@link #TYPE}.

@param rawMessage JSON message.
@return Unmarshalled message.
513164
public SnsMessage unmarshall(JsonNode rawMessage) {
        SnsJsonNode message = new SnsJsonNode(rawMessage);
        return unmarshallBase(createSubMessage(message), message).build();
    }
458418
public WebServiceTemplateBuilder setMarshaller(Marshaller marshaller) {
		return new WebServiceTemplateBuilder(this.detectHttpMessageSender,
				this.interceptors, this.internalCustomizers, this.customizers,
				this.messageSenders, marshaller, this.unmarshaller,
				this.destinationProvider, this.transformerFactoryClass,
				this.messageFactory);
	}
1113826
def from_json(raw):
    
    ncls = None
    _type = raw.get('type')
    try:
        ncls = _type_map[NodeType(_type)]
    except (KeyError, ValueError) as e:
        logger.warning('Unknown node type: %s', _type)
        if DEBUG:
            raise_from(exception.ParseException('Parse error for %s' % (_type), raw), e)
        return None
    node = ncls()
    node.load(raw)

    return node
537254
public static AbstractMessage normalize( Message srcMessage ) throws JMSException
    {
    	// Already a native message ?
        if (srcMessage instanceof AbstractMessage)
            return (AbstractMessage)srcMessage;
        
        return duplicate(srcMessage);
    }
1183583
public static JsonNode readJson(InputStream source, ClassLoader classLoader) {
        return SerializationUtils.readJson(source, classLoader);
    }
83206
@Override
	protected void unserializeFrom(RawDataBuffer in)
    {
        super.unserializeFrom(in);
        sessionId = new IntegerID(in.readInt());
        consumerId = new IntegerID(in.readInt());
        message = MessageSerializer.unserializeFrom(in, false);
        donePrefetching = in.readBoolean();
    }
60010
public JsonNode decode(byte[] bytes) throws Exception {
        JsonNode jsonNode = mapper.fromJson(bytes);
        return jsonNode;
    }
482609
private SnsMessage.Builder<? extends SnsMessage.Builder> unmarshallUnsubscribeConfirmation(SnsJsonNode message) {
        return SnsUnsubscribeConfirmation.builder(client)
                                         .withMessage(message.getString(MESSAGE))
                                         .withSubscribeUrl(message.getString(SUBSCRIBE_URL))
                                         .withToken(message.getString(TOKEN));
    }
290045
private Map<String, String> toMap(JsonNode messageJson) {
        Map<String, String> fields = new HashMap<String, String>(messageJson.size());
        Iterator<Map.Entry<String, JsonNode>> jsonFields = messageJson.fields();
        while (jsonFields.hasNext()) {
            Map.Entry<String, JsonNode> next = jsonFields.next();
            fields.put(next.getKey(), next.getValue().asText());
        }
        return fields;
    }
117295
String asJson( WebSocketMessage message ) {

		String result = null;
		try {
			ObjectMapper mapper = JSonBindingUtils.createObjectMapper();
			StringWriter writer = new StringWriter();
			mapper.writeValue( writer, message );
			result = writer.toString();

		} catch( IOException e ) {
			this.logger.severe( "A notification could not be prepared. It will not be sent. " + e.getMessage());
			Utils.logException( this.logger, e );
		}

		return result;
	}
826930
@Override
	protected void unserializeFrom(RawDataBuffer in)
    {
    	super.unserializeFrom(in);
    	int idCount = in.readInt();
        for (int i = 0; i < idCount; i++)
        {
        	String msgID = in.readUTF();
        	addDeliveredMessageID(msgID);
        }
    }
249639
protected final void initializeFromRaw( RawDataBuffer rawMessage )
    {
    	this.rawMessage = rawMessage;
    	this.unserializationLevel = MessageSerializationLevel.BASE_HEADERS;
    	
    	// Only deserialize level 1 headers
    	byte lvl1Flags = rawMessage.readByte();
    	priority     = lvl1Flags & 0x0F;
    	redelivered  = (lvl1Flags & (1 << 4)) != 0;
    	deliveryMode = (lvl1Flags & (1 << 5)) != 0 ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
    	if ((lvl1Flags & (1 << 6)) != 0) expiration = rawMessage.readLong();
    	if ((lvl1Flags & (1 << 7)) != 0) id = rawMessage.readUTF();
    	destination = DestinationSerializer.unserializeFrom(rawMessage);
    }
839585
private SnsMessage.Builder<? extends SnsMessage.Builder> unmarshallSubscriptionConfirmation(SnsJsonNode message) {
        return SnsSubscriptionConfirmation.builder(client)
                                          .withSubscribeUrl(message.getString(SUBSCRIBE_URL))
                                          .withToken(message.getString(TOKEN))
                                          .withMessage(message.getString(MESSAGE));
    }
51230
public static JsonNode toJson(final Object data) {
        if (data == null) {
            return newObject();
        }

        try {
            return createObjectMapper().valueToTree(data);
        } catch (Exception e) {
            throw new ParseException(e);
        }
    }
456150
public JsonNode toJson() {
		ObjectNode node = new ObjectMapper().createObjectNode();
		node.put("code", code);
		if (format != null) {
			node.put("format", format);
		}
		return node;
	}
644344
public Object deserialize(JsonObject message) {
    String type = message.getString("type");
    if (type == null) {
      return message.getValue("value");
    } else {
      switch (type) {
        case "buffer":
          return new Buffer(message.getBinary("value"));
        case "bytes":
          return message.getBinary("value");
        case "serialized":
          byte[] bytes = message.getBinary("value");
          ObjectInputStream stream = null;
          try {
            stream = new ThreadObjectInputStream(new ByteArrayInputStream(bytes));
            return stream.readObject();
          } catch (ClassNotFoundException | IOException e) {
            throw new SerializationException(e.getMessage());
          } finally {
            if (stream != null) {
              try {
                stream.close();
              } catch (IOException e) {
              }
            }
          }
        default:
          return message.getValue("value");
      }
    }
  }
1299020
public Object unmarshal(HierarchicalStreamReader reader,
			UnmarshallingContext context) {
		XAttributeMap map = null;
		// restore correct type of attribute map, i.e., check for buffered
		// implementation, and correctly restore lazy implementation if
		// this had been used for serialization.
		boolean lazy = reader.getAttribute("lazy").equals("true");
		boolean buffered = reader.getAttribute("buffered").equals("true");
		if (lazy) {
			if (buffered) {
				map = new XAttributeMapLazyImpl<XAttributeMapBufferedImpl>(
						XAttributeMapBufferedImpl.class);
			} else {
				map = new XAttributeMapLazyImpl<XAttributeMapImpl>(
						XAttributeMapImpl.class);
			}
		} else if (buffered) {
			map = new XAttributeMapBufferedImpl();
		} else {
			map = new XAttributeMapImpl();
		}
		while (reader.hasMoreChildren()) {
			reader.moveDown();
			XAttribute attribute = (XAttribute) context.convertAnother(map,
					XAttribute.class, XesXStreamPersistency.attributeConverter);
			map.put(attribute.getKey(), attribute);
			reader.moveUp();
		}
		return map;
	}