MacroHelpers

fm.serializer.MacroHelpers
final case class MacroHelpers(isDebug: Boolean)(using x$2: Quotes)

Attributes

Experimental
true
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def errorAndAbort(msg: String)(using Quotes): Nothing
def extractRenameFieldAnnotations[T : Type]: Map[String, String]

Extract RenameField annotations and return a Map of the Old Name => New Name

Extract RenameField annotations and return a Map of the Old Name => New Name

Attributes

def findAnyValDeserializer[T : Type]: Option[Expr[Deserializer[T]]]
def findAnyValSerializer[T : Type]: Option[Expr[Serializer[T]]]

Lookup an AnyVal Serializer

Lookup an AnyVal Serializer

Attributes

def findCollectionDeserializer[Col : Type]: Option[Expr[Deserializer[Col]]]

Lookup a Collection Serializer

Lookup a Collection Serializer

Attributes

def findCollectionSerializer[Col : Type]: Option[Expr[Serializer[Col]]]

Lookup a Collection Serializer

Lookup a Collection Serializer

Attributes

def findCommonType[T : Type]: Option[Expr[SimpleSerializer[T]]]

Common types that I would like to define in CommonTypeImplicits but require the use of a macro to create and I don't want to create a separate project to avoid the separate compilation issue with macros.

Common types that I would like to define in CommonTypeImplicits but require the use of a macro to create and I don't want to create a separate project to avoid the separate compilation issue with macros.

Attributes

def findOptionDeserializer[T : Type]: Option[Expr[Deserializer[T]]]
def findOptionSerializer[T : Type]: Option[Expr[Serializer[T]]]

Lookup an Option Serializer

Lookup an Option Serializer

Attributes

def findPrimitive[T : Type]: Option[Expr[Primitive[T]]]

Lookup a Primitive given a type T.

Lookup a Primitive given a type T.

This is shared for both Serializer and Deserializer

Attributes

def getImplicit[T](using Type[T])(using Quotes): Option[Expr[T]]
def hasImplicit[T](using Type[T])(using Quotes): Boolean
def implicitOr[A](or: => Expr[A])(using Type[A])(using Quotes): Expr[A]
def implicitOrAbort[A](using Type[A])(using Quotes): Expr[A]
def makeObjectDeserializer[T : Type](fields: Seq[Expr[Field]]): Expr[ObjectDeserializer[T]]
def makeObjectSerializer[T : Type](fields: Seq[Expr[Field]]): Expr[ObjectSerializer[T]]
def tryMakeObjectDeserializer[T : Type]: Option[Expr[ObjectDeserializer[T]]]
def tryMakeObjectSerializer[T : Type]: Option[Expr[ObjectSerializer[T]]]
def tryMakeObjectSerializerForInterface[IFACE : Type, CONCRETE : Type]: Option[Expr[ObjectSerializer[IFACE]]]

This creates an ObjectSerializer for an interface/trait based on the field information of a concrete type.

This creates an ObjectSerializer for an interface/trait based on the field information of a concrete type.

e.g. You can have a "trait Foo { def name: String }" and a "case class FooImpl(name: String)". The fields will be read from FooImpl but the serializer will be for Foo. This means the Foo must have the same methods as FooImpl for it to work.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Extensions

Extensions

extension [A](self: Type[A])(self: Type[A])
def as[B]: Type[B]