t

org.ensime.sexp.formats

FamilyFormats

trait FamilyFormats extends LowPriorityFamilyFormats

Automatically create product/coproduct marshallers (i.e. families of sealed traits and case classes/objects) for s-express.

This uses s-expression data as the underlying format, as opposed to alists. Alists are arguably a better wire format because they allow for arbitrarily complex keys, but we're applying the Principle of Least Power.

Based on spray-json-shapeless, with the same caveats.

Self Type
FamilyFormats with StandardFormats
Linear Supertypes
LowPriorityFamilyFormats, SexpFormatHints, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FamilyFormats
  2. LowPriorityFamilyFormats
  3. SexpFormatHints
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract class WrappedSexpFormat[Wrapped, SubRepr] extends AnyRef

    a SexpFormat[HList] or SexpFormat[Coproduct] would not retain the type information for the full generic that it is serialising.

    a SexpFormat[HList] or SexpFormat[Coproduct] would not retain the type information for the full generic that it is serialising. This allows us to pass the wrapped type, achieving: 1) custom CoproductHints on a per-trait level 2) configurable null behaviour on a per product level 3) clearer error messages.

    This is intentionally not an SexpFormat to avoid ambiguous implicit errors, even though it implements its interface.

    Definition Classes
    LowPriorityFamilyFormats
  2. class BasicProductHint [T] extends ProductHint[T]
    Definition Classes
    SexpFormatHints
  3. trait CoproductHint [T] extends AnyRef
    Definition Classes
    SexpFormatHints
  4. class FlatCoproductHint [T] extends CoproductHint[T]

    Product types are disambiguated by a (:key value ...).

    Product types are disambiguated by a (:key value ...). Of course, this will fail if the product type has a field with the same name as the key. The default key is the word "type" which is a keyword in Scala so unlikely to collide with too many case classes.

    Definition Classes
    SexpFormatHints
  5. class NestedCoproductHint [T] extends CoproductHint[T]

    Product types are disambiguated by an extra layer containing a single key which is the name of the type of product contained in the value.

    Product types are disambiguated by an extra layer containing a single key which is the name of the type of product contained in the value. e.g. (:my-type (...))

    Definition Classes
    SexpFormatHints
  6. trait ProductHint [T] extends AnyRef
    Definition Classes
    SexpFormatHints
  7. sealed trait SexpNilBehaviour extends AnyRef

    Sometimes the wire format needs to match an existing format and SexpNil behaviour needs to be customised.

    Sometimes the wire format needs to match an existing format and SexpNil behaviour needs to be customised. This allows null behaviour to be defined at the product level. Field level control is only possible with a user-defined SexpFormat.

    Definition Classes
    SexpFormatHints

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. implicit def cNilFormat[Wrapped]: (FamilyFormats.this)#WrappedSexpFormat[Wrapped, CNil]
    Definition Classes
    LowPriorityFamilyFormats
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. implicit def coproductFormat[Wrapped, Name <: Symbol, Instance, Remaining <: Coproduct](implicit th: (FamilyFormats.this)#CoproductHint[Wrapped], key: Aux[Name], sfh: Lazy[SexpFormat[Instance]], sft: (FamilyFormats.this)#WrappedSexpFormat[Wrapped, Remaining]): (FamilyFormats.this)#WrappedSexpFormat[Wrapped, :+:[FieldType[Name, Instance], Remaining]]
    Definition Classes
    LowPriorityFamilyFormats
  8. implicit def coproductHint[T](implicit arg0: Typeable[T]): (FamilyFormats.this)#CoproductHint[T]
    Definition Classes
    SexpFormatHints
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. implicit def familyFormat[T, Repr](implicit gen: Aux[T, Repr], sg: Cached[Strict[(FamilyFormats.this)#WrappedSexpFormat[T, Repr]]], tpe: Typeable[T]): SexpFormat[T]

    Format for LabelledGenerics that uses the HList or Coproduct marshaller above.

    Format for LabelledGenerics that uses the HList or Coproduct marshaller above.

    Blah.Aux[T, Repr] is a trick to work around scala compiler constraints. We'd really like to have only one type parameter (T) implicit list g: LabelledGeneric[T], f: Cached[Strict[SexpFormat[T.Repr]]] but that's not possible.

    Definition Classes
    LowPriorityFamilyFormats
  12. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  14. implicit def hListFormat[Wrapped, Key <: Symbol, Value, Remaining <: HList](implicit ph: (FamilyFormats.this)#ProductHint[Wrapped], key: Aux[Key], sfh: Lazy[SexpFormat[Value]], sft: (FamilyFormats.this)#WrappedSexpFormat[Wrapped, Remaining]): (FamilyFormats.this)#WrappedSexpFormat[Wrapped, ::[FieldType[Key, Value], Remaining]]
    Definition Classes
    LowPriorityFamilyFormats
  15. implicit def hNilFormat[Wrapped]: (FamilyFormats.this)#WrappedSexpFormat[Wrapped, HNil]
    Definition Classes
    LowPriorityFamilyFormats
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  21. implicit def productHint[T]: (FamilyFormats.this)#ProductHint[T]
    Definition Classes
    SexpFormatHints
  22. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. object AlwaysSexpNil extends SexpNilBehaviour with Product with Serializable

    All values serialising to SexpNil will be included in the wire format.

    All values serialising to SexpNil will be included in the wire format.

    Definition Classes
    SexpFormatHints
  28. object NeverSexpNil extends SexpNilBehaviour with Product with Serializable

    No values serialising to SexpNil will be included in the wire format.

    No values serialising to SexpNil will be included in the wire format.

    Definition Classes
    SexpFormatHints

Inherited from LowPriorityFamilyFormats

Inherited from SexpFormatHints

Inherited from AnyRef

Inherited from Any

Ungrouped