Package

com.rojoma.json.v3

util

Permalink

package util

Visibility
  1. Public
  2. All

Type Members

  1. class AlternativeJsonKey extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  2. class AlternativeJsonKeys extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  3. macro class AutomaticJsonCodec extends Annotation with StaticAnnotation

    Permalink

    Add implicit com.rojoma.json.v3.codec.JsonEncode and com.rojoma.json.v3.codec.JsonDecode instances to the annotated class.

    Add implicit com.rojoma.json.v3.codec.JsonEncode and com.rojoma.json.v3.codec.JsonDecode instances to the annotated class.

    Annotations
    @compileTimeOnly( ... ) @compileTimeOnly( ... )
    Note

    when using this macro, annotated case classes must specify context bounds explicitly rather than using ":" syntax, due to https://github.com/scala/bug/issues/10589

  4. macro class AutomaticJsonDecode extends Annotation with StaticAnnotation

    Permalink

    Add an implicit com.rojoma.json.v3.codec.JsonDecode instance to the annotated class.

    Add an implicit com.rojoma.json.v3.codec.JsonDecode instance to the annotated class.

    Annotations
    @compileTimeOnly( ... ) @compileTimeOnly( ... )
    Note

    when using this macro, annotated case classes must specify context bounds explicitly rather than using ":" syntax, due to https://github.com/scala/bug/issues/10589

  5. macro class AutomaticJsonEncode extends Annotation with StaticAnnotation

    Permalink

    Add an implicit com.rojoma.json.v3.codec.JsonEncode instance to the annotated class.

    Add an implicit com.rojoma.json.v3.codec.JsonEncode instance to the annotated class.

    Annotations
    @compileTimeOnly( ... ) @compileTimeOnly( ... )
    Note

    when using this macro, annotated case classes must specify context bounds explicitly rather than using ":" syntax, due to https://github.com/scala/bug/issues/10589

  6. case class InternalTag(fieldName: String, removeTagForSubcodec: Boolean = true) extends TagType with Product with Serializable

    Permalink

    Specifies that the base codec should add (and possibly remove) an extra field to the objects generated by the subclasses' com.rojoma.json.v3.codec.JsonEncodes and com.rojoma.json.v3.codec.JsonDecodes (and they must be objects).

    Specifies that the base codec should add (and possibly remove) an extra field to the objects generated by the subclasses' com.rojoma.json.v3.codec.JsonEncodes and com.rojoma.json.v3.codec.JsonDecodes (and they must be objects).

    Example:
    1. abstract class Base
      case class SubclassA(name: String) extends Base
      case class SubclassB(x: Int, y: Int) extends Base
      implicit val aCodec = SimpleJsonCodecBuilder[SubclassA].build("name", _.name)
      implicit val bCodec = SimpleJsonCodecBuilder[SubclassB].build("x", _.x, "y", _.y)
      val baseCodec = SimpleHierarchyCodecBuilder[Base](InternalTag("type")).
         branch[SubclassA]("a").
         branch[SubclassB]("b").
         build
      println(baseCodec.encode(SubclassA("John"))) // { "type" : "a", "name" : "John" }
      println(baseCodec.encode(SubclassB(1, 2))) // { "type" : "b", "x" : 1, "y" : 2 }
  7. abstract class JArrayProducer extends AnyRef

    Permalink
  8. final class JValueProducer extends AnyRef

    Permalink
  9. class JsonCaseInsensitiveEnum extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  10. class JsonKey extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  11. class JsonKeyStrategy extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  12. class JsonTag extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  13. class LazyCodec extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  14. sealed abstract class NoTag extends AnyRef

    Permalink

    Specifies that the base codec should not affect the subclasses' com.rojoma.json.v3.codec.JsonEncodes and com.rojoma.json.v3.codec.JsonDecodes at all and that the decoder should simply try each codec in turn, in the order they were provided to the builder, until it finds one that succeeds.

    Specifies that the base codec should not affect the subclasses' com.rojoma.json.v3.codec.JsonEncodes and com.rojoma.json.v3.codec.JsonDecodes at all and that the decoder should simply try each codec in turn, in the order they were provided to the builder, until it finds one that succeeds.

    Example:
    1. abstract class Base
      case class SubclassA(name: String) extends Base
      case class SubclassB(x: Int, y: Int) extends Base
      implicit val aCodec = SimpleJsonCodecBuilder[SubclassA].build("name", _.name)
      implicit val bCodec = SimpleJsonCodecBuilder[SubclassB].build("x", _.x, "y", _.y)
      val baseCodec = SimpleHierarchyCodecBuilder[Base](NoTag).
         branch[SubclassA].
         branch[SubclassB].
         build
      println(baseCodec.encode(SubclassA("John"))) // { "name" : "John" }
      println(baseCodec.encode(SubclassB(1, 2))) // { "x" : 1, "y" : 2 }
    See also

    com.rojoma.json.v3.util.TagType

  15. class NoTagSimpleHierarchyCodecBuilder[Root <: AnyRef] extends AnyRef

    Permalink
  16. class NoTagSimpleHierarchyDecodeBuilder[Root <: AnyRef] extends AnyRef

    Permalink
  17. class NoTagSimpleHierarchyEncodeBuilder[Root <: AnyRef] extends AnyRef

    Permalink
  18. class NullForNone extends Annotation with Annotation with ClassfileAnnotation

    Permalink
  19. class SimpleHierarchyCodecBuilder[Root <: AnyRef] extends AnyRef

    Permalink
  20. class SimpleHierarchyDecodeBuilder[Root <: AnyRef] extends AnyRef

    Permalink
  21. class SimpleHierarchyEncodeBuilder[Root <: AnyRef] extends AnyRef

    Permalink
  22. final class Strategy extends Enum[Strategy]

    Permalink
  23. case class TagAndValue(typeField: String, valueField: String) extends TagType with Product with Serializable

    Permalink

    Specifies that the base codec should wrap the value generated by subclasses' com.rojoma.json.v3.codec.JsonEncodes and com.rojoma.json.v3.codec.JsonDecodes in another object containing two fields; one for the type-tag and one for the actual value.

    Specifies that the base codec should wrap the value generated by subclasses' com.rojoma.json.v3.codec.JsonEncodes and com.rojoma.json.v3.codec.JsonDecodes in another object containing two fields; one for the type-tag and one for the actual value.

    Example:
    1. abstract class Base
      case class SubclassA(name: String) extends Base
      case class SubclassB(x: Int, y: Int) extends Base
      implicit val aCodec = SimpleJsonCodecBuilder[SubclassA].build("name", _.name)
      implicit val bCodec = SimpleJsonCodecBuilder[SubclassB].build("x", _.x, "y", _.y)
      val baseCodec = SimpleHierarchyCodecBuilder[Base](TagAndValue("type", "value")).
         branch[SubclassA]("a").
         branch[SubclassB]("b").
         build
      println(baseCodec.encode(SubclassA("John"))) // { "type" : "a", "value" : { "name" : "John" } }
      println(baseCodec.encode(SubclassB(1, 2))) // { "type" : "b", "value" : { "x" : 1, "y" : 2 } }
  24. sealed abstract class TagType extends AnyRef

    Permalink

    Specifies the mechanism for distinguishing among subclasses in a hierarchy with a tag.

    Specifies the mechanism for distinguishing among subclasses in a hierarchy with a tag.

    See also

    com.rojoma.json.v3.util.NoTag

  25. final class WrappedCharArray extends AnyRef

    Permalink

    A container for a slice of an Array[Char] which promises to allow only read-only access to that array.

    A container for a slice of an Array[Char] which promises to allow only read-only access to that array. Note it does not itself copy the array, so if there is another reference the data can be mutated by other operations.

  26. class WrappedCharArrayIterator extends AbstractBufferedIterator[Char]

    Permalink

Value Members

  1. object ArrayIteratorEncode

    Permalink

    Converting iterators-of-jsonables to iterators that represent JArrays, without holding onto the contents of the iterator.

  2. object AutomaticHierarchyCodecBuilder

    Permalink
  3. object AutomaticHierarchyDecodeBuilder

    Permalink
  4. object AutomaticHierarchyEncodeBuilder

    Permalink
  5. object AutomaticJsonCodecBuilder

    Permalink
  6. object AutomaticJsonDecodeBuilder

    Permalink
  7. object AutomaticJsonEncodeBuilder

    Permalink
  8. object JArrayProducer

    Permalink
  9. object JValueProducer

    Permalink
  10. object JsonArrayIterator

    Permalink

    Helper for reading lazily reading objects out of a source of JsonEvents representing a JSON array.

    Helper for reading lazily reading objects out of a source of JsonEvents representing a JSON array. Calling hasNext can throw any JsonLexException. Calling next() can throw any JSON lex or parse exception, or ElementDecodeException if the data in the array cannot be decoded as a T at that point. In the latter case, the iterator is still valid and positioned as if the decode had succeeded so it can continue to be used.

    returns

    An iterator of Ts

    Exceptions thrown

    JsonBadParse if alreadyInArray is false and the first event is not a StartOfArrayEvent

    JsonLexException if alreadyInArray is false and a lexing exception or EOF occurs.

  11. object JsonUtil

    Permalink
  12. object NoTag extends NoTag with Product with Serializable

    Permalink
  13. object SimpleHierarchyCodecBuilder

    Permalink
  14. object SimpleHierarchyDecodeBuilder

    Permalink
  15. object SimpleHierarchyEncodeBuilder

    Permalink
  16. object SimpleJsonCodecBuilder

    Permalink
  17. object TagToValue extends TagType with Product with Serializable

    Permalink

    Specifies that the base codec should wrap the value generated by subclasses' com.rojoma.json.v3.codec.JsonEncodes and com.rojoma.json.v3.codec.JsonDecodes in another object containing a single field, which is the tag for that subclass.

    Specifies that the base codec should wrap the value generated by subclasses' com.rojoma.json.v3.codec.JsonEncodes and com.rojoma.json.v3.codec.JsonDecodes in another object containing a single field, which is the tag for that subclass.

    Example:
    1. abstract class Base
      case class SubclassA(name: String) extends Base
      case class SubclassB(x: Int, y: Int) extends Base
      implicit val aCodec = SimpleJsonCodecBuilder[SubclassA].build("name", _.name)
      implicit val bCodec = SimpleJsonCodecBuilder[SubclassB].build("x", _.x, "y", _.y)
      val baseCodec = SimpleHierarchyCodecBuilder[Base](TagToValue).
         branch[SubclassA]("a").
         branch[SubclassB]("b").
         build
      println(baseCodec.encode(SubclassA("John"))) // { "a" : { "name" : "John" } }
      println(baseCodec.encode(SubclassB(1, 2))) // { "b" : { "x" : 1, "y" : 2 } }
  18. object WrappedCharArray

    Permalink
  19. object WrapperFieldCodec

    Permalink
  20. object WrapperFieldDecode

    Permalink
  21. object WrapperFieldEncode

    Permalink
  22. object WrapperJsonCodec

    Permalink

    Creates a combined com.rojoma.json.v3.codec.JsonEncode and com.rojoma.json.v3.codec.JsonDecode for a simple wrapper type.

    Creates a combined com.rojoma.json.v3.codec.JsonEncode and com.rojoma.json.v3.codec.JsonDecode for a simple wrapper type. The wrap function may throw IllegalArgumentException; this is translated to a com.rojoma.json.v3.codec.DecodeError.InvalidValue.

  23. object WrapperJsonDecode

    Permalink

    Creates a com.rojoma.json.v3.codec.JsonDecode for a simple wrapper type.

    Creates a com.rojoma.json.v3.codec.JsonDecode for a simple wrapper type. The wrap function may throw IllegalArgumentException; this is translated to a com.rojoma.json.v3.codec.DecodeError.InvalidValue.

  24. object WrapperJsonEncode

    Permalink

    Creates a com.rojoma.json.v3.codec.JsonEncode for a simple wrapper type.

  25. package time

    Permalink

Ungrouped