Class RawValue
- java.lang.Object
-
- com.fasterxml.jackson.databind.util.RawValue
-
- All Implemented Interfaces:
JsonSerializable
public class RawValue extends java.lang.Object implements JsonSerializable
Helper class used to encapsulate "raw values", pre-encoded textual content that can be output as opaque value with no quoting/escaping, usingJsonGenerator.writeRawValue(String)
. It may be stored inTokenBuffer
, as well as in Tree Model (JsonNode
)- Since:
- 2.6
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.fasterxml.jackson.databind.JsonSerializable
JsonSerializable.Base
-
-
Constructor Summary
Constructors Constructor Description RawValue(SerializableString v)
RawValue(JsonSerializable v)
RawValue(java.lang.String v)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
hashCode()
java.lang.Object
rawValue()
Accessor for returning enclosed raw value in whatever form it was created in (usuallyString
, {link SerializableString}, or anyJsonSerializable
).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.java.lang.String
toString()
-
-
-
Constructor Detail
-
RawValue
public RawValue(java.lang.String v)
-
RawValue
public RawValue(SerializableString v)
-
RawValue
public RawValue(JsonSerializable v)
-
-
Method Detail
-
rawValue
public java.lang.Object rawValue()
Accessor for returning enclosed raw value in whatever form it was created in (usuallyString
, {link SerializableString}, or anyJsonSerializable
).
-
serialize
public void serialize(JsonGenerator gen, SerializerProvider serializers) throws java.io.IOException
Description copied from interface:JsonSerializable
Serialization method called when no additional type information is to be included in serialization.- Specified by:
serialize
in interfaceJsonSerializable
- Throws:
java.io.IOException
-
serializeWithType
public void serializeWithType(JsonGenerator gen, SerializerProvider serializers, TypeSerializer typeSer) throws java.io.IOException
Description copied from interface:JsonSerializable
Serialization method called when additional type information is expected to be included in serialization, for deserialization to use.Usually implementation consists of a call to
TypeSerializer.writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
followed by serialization of contents, followed by a call toTypeSerializer.writeTypeSuffix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
). Details of the type id argument to pass 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.
- Specified by:
serializeWithType
in interfaceJsonSerializable
- Throws:
java.io.IOException
-
serialize
public void serialize(JsonGenerator gen) throws java.io.IOException
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-