Example usage for com.fasterxml.jackson.core JsonToken VALUE_EMBEDDED_OBJECT

List of usage examples for com.fasterxml.jackson.core JsonToken VALUE_EMBEDDED_OBJECT

Introduction

In this page you can find the example usage for com.fasterxml.jackson.core JsonToken VALUE_EMBEDDED_OBJECT.

Prototype

JsonToken VALUE_EMBEDDED_OBJECT

To view the source code for com.fasterxml.jackson.core JsonToken VALUE_EMBEDDED_OBJECT.

Click Source Link

Document

Placeholder token returned when the input source has a concept of embedded Object that are not accessible as usual structure (of starting with #START_OBJECT , having values, ending with #END_OBJECT ), but as "raw" objects.

Usage

From source file:de.undercouch.bson4jackson.BsonParser.java

/**
 * Reads a DBPointer from the stream// w w w .jav a 2 s.c  om
 * @return the json token read
 * @throws IOException if an I/O error occurs
 */
protected JsonToken handleDBPointer() throws IOException {
    Map<String, Object> pointer = new LinkedHashMap<String, Object>();
    pointer.put("$ns", readString());
    pointer.put("$id", readObjectId());
    getContext().value = pointer;
    return JsonToken.VALUE_EMBEDDED_OBJECT;
}

From source file:de.undercouch.bson4jackson.BsonParser.java

/**
 * Can be called when embedded javascript code with scope is found. Reads
 * the code and the embedded document.//from w w w.  java 2s.com
 * @return the json token read
 * @throws IOException if an I/O error occurs
 */
protected JsonToken handleJavascriptWithScope() throws IOException {
    //skip size
    _in.readInt();
    String code = readString();
    Map<String, Object> doc = readDocument();
    getContext().value = new JavaScript(code, doc);
    return JsonToken.VALUE_EMBEDDED_OBJECT;
}