Class 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, using JsonGenerator.writeRawValue(String). It may be stored in TokenBuffer, as well as in Tree Model (JsonNode)
    Since:
    2.6
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Object _value
      Contents to serialize.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        RawValue​(com.fasterxml.jackson.core.SerializableString v)  
        RawValue​(JsonSerializable v)  
      protected RawValue​(java.lang.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​(java.lang.String v)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void _serialize​(com.fasterxml.jackson.core.JsonGenerator gen)  
      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 (usually String, {link SerializableString}, or any JsonSerializable).
      void serialize​(com.fasterxml.jackson.core.JsonGenerator gen)  
      void serialize​(com.fasterxml.jackson.core.JsonGenerator gen, SerializerProvider serializers)
      Serialization method called when no additional type information is to be included in serialization.
      void serializeWithType​(com.fasterxml.jackson.core.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()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • _value

        protected java.lang.Object _value
        Contents to serialize. Untyped because there are multiple types that are supported: String, JsonSerializable, SerializableString.
    • Constructor Detail

      • RawValue

        public RawValue​(java.lang.String v)
      • RawValue

        public RawValue​(com.fasterxml.jackson.core.SerializableString v)
      • RawValue

        protected RawValue​(java.lang.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. Caller has to take care that values of types not supported by base implementation are handled properly, usually by overriding some of existing serialization methods.
    • Method Detail

      • rawValue

        public java.lang.Object rawValue()
        Accessor for returning enclosed raw value in whatever form it was created in (usually String, {link SerializableString}, or any JsonSerializable).
      • serialize

        public void serialize​(com.fasterxml.jackson.core.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 interface JsonSerializable
        Throws:
        java.io.IOException
      • serialize

        public void serialize​(com.fasterxml.jackson.core.JsonGenerator gen)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • _serialize

        protected void _serialize​(com.fasterxml.jackson.core.JsonGenerator gen)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object