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
- Alphabetic
- By Inheritance
- FamilyFormats
- LowPriorityFamilyFormats
- SexpFormatHints
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
abstract
class
WrappedSexpFormat[Wrapped, SubRepr] extends AnyRef
a
SexpFormat[HList]orSexpFormat[Coproduct]would not retain the type information for the full generic that it is serialising.a
SexpFormat[HList]orSexpFormat[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) customCoproductHints on a per-trait level 2) configurablenullbehaviour on a per product level 3) clearer error messages.This is intentionally not an
SexpFormatto avoid ambiguous implicit errors, even though it implements its interface.- Definition Classes
- LowPriorityFamilyFormats
-
class
BasicProductHint[T] extends ProductHint[T]
- Definition Classes
- SexpFormatHints
-
trait
CoproductHint[T] extends AnyRef
- Definition Classes
- SexpFormatHints
-
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
-
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
-
trait
ProductHint[T] extends AnyRef
- Definition Classes
- SexpFormatHints
-
sealed
trait
SexpNilBehaviour extends AnyRef
Sometimes the wire format needs to match an existing format and
SexpNilbehaviour needs to be customised.Sometimes the wire format needs to match an existing format and
SexpNilbehaviour needs to be customised. This allows null behaviour to be defined at the product level. Field level control is only possible with a user-definedSexpFormat.- Definition Classes
- SexpFormatHints
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
implicit
def
cNilFormat[Wrapped]: (FamilyFormats.this)#WrappedSexpFormat[Wrapped, CNil]
- Definition Classes
- LowPriorityFamilyFormats
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
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
-
implicit
def
coproductHint[T](implicit arg0: Typeable[T]): (FamilyFormats.this)#CoproductHint[T]
- Definition Classes
- SexpFormatHints
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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
LabelledGenericsthat uses theHListorCoproductmarshaller above.Format for
LabelledGenericsthat uses theHListorCoproductmarshaller 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 listg: LabelledGeneric[T], f: Cached[Strict[SexpFormat[T.Repr]]]but that's not possible.- Definition Classes
- LowPriorityFamilyFormats
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
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
-
implicit
def
hNilFormat[Wrapped]: (FamilyFormats.this)#WrappedSexpFormat[Wrapped, HNil]
- Definition Classes
- LowPriorityFamilyFormats
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
implicit
def
productHint[T]: (FamilyFormats.this)#ProductHint[T]
- Definition Classes
- SexpFormatHints
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
object
AlwaysSexpNil extends SexpNilBehaviour with Product with Serializable
All values serialising to
SexpNilwill be included in the wire format.All values serialising to
SexpNilwill be included in the wire format.- Definition Classes
- SexpFormatHints
-
object
NeverSexpNil extends SexpNilBehaviour with Product with Serializable
No values serialising to
SexpNilwill be included in the wire format.No values serialising to
SexpNilwill be included in the wire format.- Definition Classes
- SexpFormatHints