public class RawValue extends Object implements JsonSerializable
JsonGenerator.writeRawValue(String)
.
It may be stored in TokenBuffer
, as well as in Tree Model
(JsonNode
)JsonSerializable.Base
Modifier and Type | Field and Description |
---|---|
protected Object |
_value
Contents to serialize.
|
Modifier | Constructor and Description |
---|---|
|
RawValue(JsonSerializable v) |
protected |
RawValue(Object value,
boolean bogus)
Constructor that may be used by sub-classes, and allows passing value
types other than ones for which explicit constructor exists.
|
|
RawValue(SerializableString v) |
|
RawValue(String v) |
Modifier and Type | Method and Description |
---|---|
protected void |
_serialize(JsonGenerator gen) |
boolean |
equals(Object o) |
int |
hashCode() |
Object |
rawValue()
Accessor for returning enclosed raw value in whatever form it was created in
(usually
String , {link SerializableString}, or any JsonSerializable ). |
void |
serialize(JsonGenerator gen) |
void |
serialize(JsonGenerator gen,
SerializerProvider serializers)
Serialization method called when no additional type information is
to be included in serialization.
|
void |
serializeWithType(JsonGenerator gen,
SerializerProvider serializers,
TypeSerializer typeSer)
Serialization method called when additional type information is
expected to be included in serialization, for deserialization to use.
|
String |
toString() |
protected Object _value
String
, JsonSerializable
, SerializableString
.public RawValue(String v)
public RawValue(SerializableString v)
public RawValue(JsonSerializable v)
protected RawValue(Object value, boolean bogus)
public Object rawValue()
String
, {link SerializableString}, or any JsonSerializable
).public void serialize(JsonGenerator gen, SerializerProvider serializers) throws IOException
JsonSerializable
serialize
in interface JsonSerializable
IOException
public void serializeWithType(JsonGenerator gen, SerializerProvider serializers, TypeSerializer typeSer) throws IOException
JsonSerializable
Usually implementation consists of a call to one of methods
in TypeSerializer
(such as TypeSerializer.writeTypePrefixForObject(Object, JsonGenerator)
)
followed by serialization of contents,
followed by another call to TypeSerializer
(such as TypeSerializer.writeTypeSuffixForObject(Object, JsonGenerator)
).
Exact methods to call in TypeSerializer
depend on shape of JSON Object used
(Array, Object or scalar like String/Number/Boolean).
Note that some types (most notably, "natural" types: String, Integer, Double and Boolean) never include type information.
serializeWithType
in interface JsonSerializable
IOException
public void serialize(JsonGenerator gen) throws IOException
IOException
protected void _serialize(JsonGenerator gen) throws IOException
IOException
Copyright © 2008–2017 FasterXML. All rights reserved.