Package

fm

serializer

Permalink

package serializer

Visibility
  1. Public
  2. All

Type Members

  1. final class BooleanPrimitive extends Primitive[Boolean]

    Permalink
  2. final class Buffer extends AnyRef

    Permalink
  3. final class ByteArrayPrimitive extends Primitive[Array[Byte]]

    Permalink
  4. final class CanBuildFromDeserializer[Elem, Col] extends CollectionDeserializerBase[Col]

    Permalink
  5. final class CharPrimitive extends Primitive[Char]

    Permalink
  6. abstract class CollectionDeserializerBase[Col] extends Deserializer[Col]

    Permalink
  7. trait CollectionInput extends NestedInput

    Permalink

    For reading Collections

  8. trait CommonTypeImplicits extends AnyRef

    Permalink

    These are implicit serializers/deserializers for common types that do not require the use of a macro to generate.

    These are implicit serializers/deserializers for common types that do not require the use of a macro to generate.

    Common types that DO require a macro are embedded into the makeSerializer/makeDeserializer via MacroHelpers.tryCommonType() since we can't call macros from here without creating a separate compilation package.

  9. trait Deserializer[T] extends RawDeserializer[T] with NestedDeserializer[T]

    Permalink
  10. trait DeserializerLowPrioImplicits extends AnyRef

    Permalink
  11. final class DeserializerProxy[T] extends Deserializer[T]

    Permalink
  12. final class DoublePrimitive extends Primitive[Double]

    Permalink
  13. final class FMByteArrayOutputStream extends OutputStream with Appendable

    Permalink

    A ByteArrayOutputStream implementation optimized for writing binary serialized data (e.g.

    A ByteArrayOutputStream implementation optimized for writing binary serialized data (e.g. Protocol Buffers).

    Tries to avoid excessive memory allocations and array resizing by using an Array of Byte Arrays to represent the data. Supports directly appending Byte Arrays (zero-copy), writing length prefixed data, optimized writing of ASCII and UTF-8 strings without going through a java.io.Writer.

  14. final class Field extends Annotation with StaticAnnotation

    Permalink
    Annotations
    @getter() @setter() @param()
  15. trait FieldInput extends NestedInput

    Permalink

    FIELD Input

    FIELD Input

    This the extra methods for reading FIELD input along with the NestedInput methods

  16. trait FieldOutput extends AnyRef

    Permalink

    FIELD Output

    FIELD Output

    See the documentation for Output

  17. trait FieldSerializer[T] extends AnyRef

    Permalink
  18. final class FixedIntPrimitive extends Primitive[Int]

    Permalink
  19. final class FixedLongPrimitive extends Primitive[Long]

    Permalink
  20. final class FloatPrimitive extends Primitive[Float]

    Permalink
  21. final class GrowableDeserializer[Elem, Col <: Growable[Elem]] extends CollectionDeserializerBase[Col]

    Permalink
  22. final class IPSerializer extends SimpleSerializer[IP]

    Permalink
  23. final class ImmutableArrayDeserializer[Elem, Col >: ImmutableArray[Elem]] extends CollectionDeserializerBase[Col]

    Permalink

    A specialized implementation for deserializing ImmutableArrays.

  24. final class ImmutableByteArrayPrimitive extends Primitive[ImmutableArray[Byte]]

    Permalink
  25. final class ImmutableIntArrayDeserializer extends CollectionDeserializerBase[ImmutableArray[Int]]

    Permalink
  26. final class ImmutableLongArrayDeserializer extends CollectionDeserializerBase[ImmutableArray[Long]]

    Permalink
  27. trait Input extends FieldInput with CollectionInput with NestedInput with RawInput

    Permalink

    Generic Input trait to be implemented by Serialization Implementations

    Generic Input trait to be implemented by Serialization Implementations

    See the docs for Output for the distinction between RAW, NESTED, and FIELD Input/Output. The only difference for Input is that there aren't readNestedXXX() methods. Instead the way fields for objects are read is:

    • readFieldNumber(...) to get the name/number of the field
    • readNestedXXX() to get the value of the field (based on looking up the proper type given the name/number)
  28. final class IntPrimitive extends Primitive[Int]

    Permalink
  29. final class JavaBigDecimalPrimitive extends Primitive[BigDecimal]

    Permalink
  30. final class JavaBigIntegerPrimitive extends Primitive[BigInteger]

    Permalink
  31. final class JavaCollectionDeserializer[Elem, Col <: Collection[Elem]] extends CollectionDeserializerBase[Col]

    Permalink
  32. final class JavaIterableSerializer[T, Col <: Iterable[T]] extends Serializer[Col] with FieldSerializer[Col]

    Permalink

    A Serializer/FieldSerializer for a Java Iterable

  33. final class LinkedByteArrayOutputStream extends OutputStream

    Permalink
  34. final class LongPrimitive extends Primitive[Long]

    Permalink
  35. abstract class MacroHelpers extends AnyRef

    Permalink
  36. final class MappedSimpleSerializer[A, B] extends SimpleSerializer[B]

    Permalink
  37. trait Mapper[A, B] extends AnyRef

    Permalink
  38. trait NestedDeserializer[T] extends AnyRef

    Permalink
  39. trait NestedInput extends AnyRef

    Permalink

    NESTED Input

    NESTED Input

    See documentation for Input/Output traits

  40. trait NestedOutput extends AnyRef

    Permalink

    NESTED Output

    NESTED Output

    See the documentation for Output

  41. trait NestedSerializer[T] extends AnyRef

    Permalink
  42. trait ObjectDeserializer[T] extends Deserializer[T]

    Permalink

    A combined Object Serializer/Deserializer that Serializes/Deserializes Objects from/to the same type

  43. trait ObjectSerializer[T] extends Serializer[T]

    Permalink

    A combined Object Serializer/Deserializer that Serializes/Deserializes Objects from/to the same type

  44. final case class OptionDeserializer[A]()(implicit deser: Deserializer[A]) extends Deserializer[Option[A]] with Product with Serializable

    Permalink

    For deserializing Option types.

    For deserializing Option types. Note: this does NOT allow Some(null)

  45. final case class OptionSerializer[A]()(implicit ser: Serializer[A]) extends Serializer[Option[A]] with Product with Serializable

    Permalink
  46. trait Output extends FieldOutput with NestedOutput with RawOutput

    Permalink

    Generic Output trait to be implemented by Serialization Implementations

    Generic Output trait to be implemented by Serialization Implementations

    There are 3 classes of outputs:

    • RAW
    • NESTED
    • FIELD

    RAW Raw output is what you get if you serialize something by itself. Depending on the serialization implementation it will probably have an implicit length determined by the length of an Array[Byte], String, InputStream, etc. The starting point for serializing something it usually invoking one of the writeRawXXX(...) methods. The writeRawXXX(...) methods should be implemented by all serialization implementations.

    NESTED Nested output is what we use when something is serialized as part of something else and may or may not be different than RAW output depending on the serialization implementation. For example, when serializing a collection each element would be serialized using the writeNestedXXX(...) methods. The nested format might have additional length information compared to the RAW format since there is no implicit length. For example, in protocol buffers a string/object/collection is prefixed with its length. Most serialization implementations can probably write optional length information followed by calling the corresponding writeRawXXX(...) method.

    Another way to think about nested output is what we should be able to deserialize a NESTED value that is in the middle of an array of bytes (or a string or whatever). This means we need to know when to stop reading the value. For something like Protocol Buffers we will be prepending the length for string/object/repeated field or have a marker bit for varints to know when to stop. For something like JSON we will hit a double-quote (for strings) for a comma or closing brace (for all other types).

    FIELD Field output is used when writing fields of an object. In addition to the value we are serializing it contains the name/number of the field in the object. Most implementations will probably write out the field name/number information followed by a call to the corresponding writeNestedXXX(...) method. Some implementations, such as Protocol Buffers, writes out the type of the field as part of the name/number which is why there isn't just a writeFieldName(...) which the framework would call automatically followed by the appropriate writeNestedXXX(...).

    NOTE - Reading field output (via Input) is broken into a readFieldNumber() call to get the name/number of the field followed by calls to readNestedXXX().

    Things are broken out this way to mainly support more complex formats (like Protocol Buffers). For something like a JSON implementation the RAW and NESTED formats will probably be the same. The way in which we write out JSON fields as part of an object will also be the same no matter what the type is unlike something like Protocol Buffers which needs to encode the type of field as part of the name/number of the field.

  47. sealed trait Primitive[T] extends SimpleSerializer[T]

    Permalink
  48. trait PrimitiveImplicits extends AnyRef

    Permalink

    These are the default implicits for primitives

  49. trait RawDeserializer[T] extends AnyRef

    Permalink
  50. trait RawInput extends AnyRef

    Permalink

    RAW Input

    RAW Input

    See documentation for Input/Output traits

  51. trait RawOutput extends AnyRef

    Permalink

    RAW Output

    RAW Output

    See the documentation for Output

  52. trait RawSerializer[T] extends AnyRef

    Permalink
  53. final class RenameField extends Annotation with StaticAnnotation

    Permalink
    Annotations
    @getter() @setter() @param()
  54. final class ScalaBigDecimalPrimitive extends Primitive[BigDecimal]

    Permalink
  55. final class ScalaBigIntPrimitive extends Primitive[BigInt]

    Permalink
  56. trait SerializableCompanion[A] extends AnyRef

    Permalink

    Usage Pattern:

    Usage Pattern:

    import fm.serializer.{SerializableCompanion, SerializableInstance, SimpleSerializer}

    object Foo extends SerializableCompanion[Foo] { protected val serializer: SimpleSerializer[Foo] = makeSerializer[Foo] }

    final case class Foo(bar: String) extends SerializableInstance[Foo] { protected def companion: SerializableCompanion[Foo] = Foo }

  57. trait SerializableInstance[A] extends AnyRef

    Permalink

    Usage Pattern:

    Usage Pattern:

    import fm.serializer.{SerializableCompanion, SerializableInstance, SimpleSerializer}

    object Foo extends SerializableCompanion[Foo] { protected val serializer: SimpleSerializer[Foo] = makeSerializer[Foo] }

    final case class Foo(bar: String) extends SerializableInstance[Foo] { protected def companion: SerializableCompanion[Foo] = Foo }

  58. trait Serializer[T] extends RawSerializer[T] with NestedSerializer[T] with FieldSerializer[T]

    Permalink
  59. trait SerializerLowPrioImplicits extends AnyRef

    Permalink
  60. final class SerializerProxy[T] extends Serializer[T]

    Permalink
  61. final class SignedIntPrimitive extends Primitive[Int]

    Permalink
  62. final class SignedLongPrimitive extends Primitive[Long]

    Permalink
  63. final case class SimpleObjectSerializer[T]()(implicit ser: ObjectSerializer[T], deser: ObjectDeserializer[T]) extends ObjectSerializer[T] with ObjectDeserializer[T] with SimpleSerializer[T] with Product with Serializable

    Permalink
  64. trait SimpleSerializer[A] extends Serializer[A] with Deserializer[A]

    Permalink

    A combined Serializer/Deserializer that works on the same type

  65. final class StringMapCanBuildFromDeserializer[V, Col] extends Deserializer[Col]

    Permalink
  66. final class StringMapGrowableDeserializer[V, Col <: Growable[(String, V)]] extends Deserializer[Col]

    Permalink
  67. final class StringMapSerializer[V, Col <: TraversableOnce[(String, V)]] extends Serializer[Col]

    Permalink

    A Serializer for a Map[String,V] (or rather TraversableOnce[(String,V)]) that allows us to output a JSON Object for a Map[String,V] instead of an Array[(String,V)].

    A Serializer for a Map[String,V] (or rather TraversableOnce[(String,V)]) that allows us to output a JSON Object for a Map[String,V] instead of an Array[(String,V)]. If the underlying Output doesn't support this style (e.g. Protobuf) then the TraversableOnceSerializer is used instead.

  68. final class StringPrimitive extends Primitive[String]

    Permalink
  69. final class StringUtils extends AnyRef

    Permalink
  70. final class TraversableOnceSerializer[T, Col <: TraversableOnce[T]] extends Serializer[Col]

    Permalink

    A Serializer for a TraversableOnce

  71. final class UnsignedIntPrimitive extends Primitive[Int]

    Permalink
  72. final class UnsignedLongPrimitive extends Primitive[Long]

    Permalink
  73. final class VectorDeserializer[Elem, Col >: Vector[Elem]] extends CollectionDeserializerBase[Col]

    Permalink

    A specialized implementation for deserializing Vectors.

Value Members

  1. object BooleanOptionDeserializer extends Deserializer[Option[Boolean]]

    Permalink

    A Specialzed Option[Boolean] deserializer that uses the fm-common OptionCache via the Some.cached implicit

  2. object Buffer

    Permalink
  3. object CanBuildFromDeserializer

    Permalink
  4. object CharOptionDeserializer extends Deserializer[Option[Char]]

    Permalink

    A Specialzed Option[Char] deserializer that uses the fm-common OptionCache via the Some.cached implicit

  5. object Deserializer extends DeserializerLowPrioImplicits with PrimitiveImplicits with CommonTypeImplicits with BsonImplicits

    Permalink
  6. object FMByteArrayOutputStream

    Permalink
  7. object IntOptionDeserializer extends Deserializer[Option[Int]]

    Permalink

    A Specialzed Option[Int] deserializer that uses the fm-common OptionCache via the Some.cached implicit

  8. object LinkedByteArrayOutputStream

    Permalink
  9. object LongOptionDeserializer extends Deserializer[Option[Long]]

    Permalink

    A Specialzed Option[Long] deserializer that uses the fm-common OptionCache via the Some.cached implicit

  10. object Macros

    Permalink
  11. object ObjectDeserializer

    Permalink
  12. object ObjectSerializer

    Permalink
  13. object Primitive extends PrimitiveImplicits

    Permalink
  14. object PrimitiveImplicits extends PrimitiveImplicits

    Permalink
  15. object Serializer extends SerializerLowPrioImplicits with PrimitiveImplicits with CommonTypeImplicits with BsonImplicits

    Permalink
  16. object SimpleObjectSerializer extends Serializable

    Permalink
  17. object StringMapCanBuildFromDeserializer

    Permalink
  18. package base64

    Permalink
  19. package bson

    Permalink
  20. package fastutil

    Permalink
  21. package jackson

    Permalink
  22. package json

    Permalink
  23. package protobuf

    Permalink
  24. package validation

    Permalink

Ungrouped