Packages

p

fm

serializer

package serializer

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. final class BooleanPrimitive extends Primitive[Boolean]
  2. final class Buffer extends AnyRef
  3. final class ByteArrayPrimitive extends Primitive[Array[Byte]]
  4. final class CanBuildFromDeserializer[Elem, Col] extends CollectionDeserializerBase[Col]
  5. final class CharPrimitive extends Primitive[Char]
  6. abstract class CollectionDeserializerBase[Col] extends Deserializer[Col]
  7. trait CollectionInput extends NestedInput

    For reading Collections

  8. trait CommonTypeImplicits extends AnyRef

    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]
  10. trait DeserializerLowPrioImplicits extends AnyRef
  11. final class DeserializerProxy[T] extends Deserializer[T]
  12. final class DoublePrimitive extends Primitive[Double]
  13. final class FMByteArrayOutputStream extends OutputStream with Appendable

    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
    Annotations
    @getter() @setter() @param()
  15. trait FieldInput extends NestedInput

    FIELD Input

    FIELD Input

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

  16. trait FieldOutput extends AnyRef

    FIELD Output

    FIELD Output

    See the documentation for Output

  17. trait FieldSerializer[T] extends AnyRef
  18. final class FixedIntPrimitive extends Primitive[Int]
  19. final class FixedLongPrimitive extends Primitive[Long]
  20. final class FloatPrimitive extends Primitive[Float]
  21. final class GrowableDeserializer[Elem, Col <: Growable[Elem]] extends CollectionDeserializerBase[Col]
  22. final class IPSerializer extends SimpleSerializer[IP]
  23. final class ImmutableArrayDeserializer[Elem, Col >: ImmutableArray[Elem]] extends CollectionDeserializerBase[Col]

    A specialized implementation for deserializing ImmutableArrays.

  24. final class ImmutableByteArrayPrimitive extends Primitive[ImmutableArray[Byte]]
  25. final class ImmutableIntArrayDeserializer extends CollectionDeserializerBase[ImmutableArray[Int]]
  26. final class ImmutableLongArrayDeserializer extends CollectionDeserializerBase[ImmutableArray[Long]]
  27. trait Input extends FieldInput with CollectionInput with NestedInput with RawInput

    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]
  29. final class JavaCollectionDeserializer[Elem, Col <: Collection[Elem]] extends CollectionDeserializerBase[Col]
  30. final class JavaIterableSerializer[T, Col <: Iterable[T]] extends Serializer[Col] with FieldSerializer[Col]

    A Serializer/FieldSerializer for a Java Iterable

  31. final class LinkedByteArrayOutputStream extends OutputStream
  32. final class LongPrimitive extends Primitive[Long]
  33. abstract class MacroHelpers extends AnyRef
  34. final class MappedSimpleSerializer[A, B] extends SimpleSerializer[B]
  35. trait Mapper[A, B] extends AnyRef
  36. trait NestedDeserializer[T] extends AnyRef
  37. trait NestedInput extends AnyRef

    NESTED Input

    NESTED Input

    See documentation for Input/Output traits

  38. trait NestedOutput extends AnyRef

    NESTED Output

    NESTED Output

    See the documentation for Output

  39. trait NestedSerializer[T] extends AnyRef
  40. trait ObjectDeserializer[T] extends Deserializer[T]

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

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

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

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

    For deserializing Option types.

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

  43. final case class OptionSerializer[A]()(implicit ser: Serializer[A]) extends Serializer[Option[A]] with Product with Serializable
  44. trait Output extends FieldOutput with NestedOutput with RawOutput

    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.

  45. sealed trait Primitive[T] extends SimpleSerializer[T]
  46. trait PrimitiveImplicits extends AnyRef

    These are the default implicits for primitives

  47. trait RawDeserializer[T] extends AnyRef
  48. trait RawInput extends AnyRef

    RAW Input

    RAW Input

    See documentation for Input/Output traits

  49. trait RawOutput extends AnyRef

    RAW Output

    RAW Output

    See the documentation for Output

  50. trait RawSerializer[T] extends AnyRef
  51. final class RenameField extends Annotation with StaticAnnotation
    Annotations
    @getter() @setter() @param()
  52. trait SerializableCompanion[A] extends AnyRef

    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 }

  53. trait SerializableInstance[A] extends AnyRef

    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 }

  54. trait Serializer[T] extends RawSerializer[T] with NestedSerializer[T] with FieldSerializer[T]
  55. trait SerializerLowPrioImplicits extends AnyRef
  56. final class SerializerProxy[T] extends Serializer[T]
  57. final class SignedIntPrimitive extends Primitive[Int]
  58. final class SignedLongPrimitive extends Primitive[Long]
  59. 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
  60. trait SimpleSerializer[A] extends Serializer[A] with Deserializer[A]

    A combined Serializer/Deserializer that works on the same type

  61. final class StringMapCanBuildFromDeserializer[V, Col] extends Deserializer[Col]
  62. final class StringMapGrowableDeserializer[V, Col <: Growable[(String, V)]] extends Deserializer[Col]
  63. final class StringMapSerializer[V, Col <: TraversableOnce[(String, V)]] extends Serializer[Col]

    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.

  64. final class StringPrimitive extends Primitive[String]
  65. final class StringUtils extends AnyRef

    Some non-public helpers from java.lang.{Integer,Long}

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

    A Serializer for a TraversableOnce

  67. final class UnsignedIntPrimitive extends Primitive[Int]
  68. final class UnsignedLongPrimitive extends Primitive[Long]
  69. final class VectorDeserializer[Elem, Col >: Vector[Elem]] extends CollectionDeserializerBase[Col]

    A specialized implementation for deserializing Vectors.

Value Members

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

    A Specialzed Option[Boolean] deserializer that uses static true/false values to prevent allocating memory.

  2. object Buffer
  3. object CanBuildFromDeserializer
  4. object Deserializer extends DeserializerLowPrioImplicits with PrimitiveImplicits with CommonTypeImplicits with BsonImplicits
  5. object FMByteArrayOutputStream
  6. object IntOptionDeserializer extends Deserializer[Option[Int]]

    Note: This caches Option[Int] instances (much like java.lang.Integer caches Integer instances).

    Note: This caches Option[Int] instances (much like java.lang.Integer caches Integer instances). By default the cache attempts to use the same range that the java.lang.Integer cache uses but the method used to determine the range is somewhat dependant on how OpenJDK handles caching. You can override the default upper limit using the "fm.serializer.IntOptionDeserializer.Cache.high" system property if the default behavior of trying to detect the java.lang.Integer cache range doesn't work for you.

  7. object LinkedByteArrayOutputStream
  8. object Macros
  9. object ObjectDeserializer
  10. object ObjectSerializer
  11. object Primitive extends PrimitiveImplicits
  12. object PrimitiveImplicits extends PrimitiveImplicits
  13. object Serializer extends SerializerLowPrioImplicits with PrimitiveImplicits with CommonTypeImplicits with BsonImplicits
  14. object SimpleObjectSerializer extends Serializable
  15. object StringMapCanBuildFromDeserializer

Ungrouped