Class

com.qvantel.jsonapi

Macros

Related Doc: package jsonapi

Permalink

final class Macros extends JsonApiWriters with JsonApiReaders

Contains macros used to automatically create JsonApiWriter and JsonApiFormat instances from a case class for http://jsonapi.org format.

The JsonApiFormat it self is not yet complete. The read side returns Nothing (???) and thus will crash with scala.NotImplementedError

In the case class you have to provide 2 implicits after of which you can create an instance of the JsonApiFormat or JsonApiWriter. Example for a case class called Individual.

implicit val individualResourceType: ResourceType[Individual] = "individuals"
implicit val individualPathTo: PathTo[Individual] = new PathTo[Individual] {
  private[this] val root = Path("/individuals")
  override final def self(id: String): Path = root / id
}
// After these you can generate the format like this
implicit val individualJsonFormat: JsonApiFormat[Individual] = jsonApiFormat[Individual]
Annotations
@compileTimeOnly( ... )
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Macros
  2. JsonApiReaders
  3. JsonApiWriters
  4. JsonApiCommon
  5. Tools
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Macros(c: Context)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val c: Context

    Permalink
    Definition Classes
    MacrosTools
  6. def camelToDashes(name: String): String

    Permalink
    Definition Classes
    JsonApiCommon
  7. def caseClassFields(t: scala.reflect.macros.blackbox.Context.Type): List[scala.reflect.macros.Universe.TermSymbol]

    Permalink
    Definition Classes
    JsonApiCommon
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def coproductPattern(n: Int, name: scala.reflect.macros.Universe.TermName): scala.reflect.macros.blackbox.Context.Tree

    Permalink
    Definition Classes
    Tools
  10. def coproductPatterns(nTypes: Int, name: scala.reflect.macros.Universe.TermName): Seq[scala.reflect.macros.blackbox.Context.Tree]

    Permalink
    Definition Classes
    Tools
  11. def coproductTypes(t: scala.reflect.macros.blackbox.Context.Type): List[scala.reflect.macros.blackbox.Context.Type]

    Permalink
    Definition Classes
    Tools
  12. def createIncludes[A](implicit arg0: scala.reflect.macros.blackbox.Context.WeakTypeTag[A]): scala.reflect.macros.blackbox.Context.Tree

    Permalink
  13. def createWriter(t: scala.reflect.macros.blackbox.Context.Type): scala.reflect.macros.blackbox.Context.Tree

    Permalink
    Definition Classes
    JsonApiWriters
  14. def emptyForIterableType(t: scala.reflect.macros.blackbox.Context.Type): scala.reflect.macros.blackbox.Context.Tree

    Permalink
    Definition Classes
    JsonApiCommon
  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  20. def includeAllowed(t: scala.reflect.macros.blackbox.Context.Type, includeParam: scala.reflect.macros.Universe.TermName, incMap: scala.reflect.macros.Universe.TermName): scala.reflect.macros.blackbox.Context.Tree

    Permalink
    Definition Classes
    JsonApiWriters
  21. def includedWriter(t: scala.reflect.macros.blackbox.Context.Type, objName: scala.reflect.macros.Universe.TermName): scala.reflect.macros.blackbox.Context.Tree

    Permalink
    Definition Classes
    JsonApiWriters
  22. def includesMap(t: scala.reflect.macros.blackbox.Context.Type): scala.reflect.macros.blackbox.Context.Tree

    Permalink
    Definition Classes
    JsonApiWriters
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def jsonApiFormatWithNoNameManglingImpl[A](implicit arg0: scala.reflect.macros.blackbox.Context.WeakTypeTag[A]): scala.reflect.macros.blackbox.Context.Tree

    Permalink
  25. def jsonApiWriterWithNoNameManglingImpl[A](implicit arg0: scala.reflect.macros.blackbox.Context.WeakTypeTag[A]): scala.reflect.macros.blackbox.Context.Tree

    Permalink
  26. val jsonOptionType: scala.reflect.macros.Universe.Type

    Permalink
    Definition Classes
    JsonApiCommon
  27. val jsonOptionalPolyToOneType: scala.reflect.macros.Universe.Type

    Permalink
    Definition Classes
    JsonApiCommon
  28. val jsonOptionalToOneType: scala.reflect.macros.Universe.Type

    Permalink
    Definition Classes
    JsonApiCommon
  29. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. val optionType: scala.reflect.macros.Universe.Type

    Permalink
    Definition Classes
    JsonApiCommon
  33. val optionalPolyToOneType: scala.reflect.macros.Universe.Type

    Permalink
    Definition Classes
    JsonApiCommon
  34. val optionalToOneType: scala.reflect.macros.Universe.Type

    Permalink
    Definition Classes
    JsonApiCommon
  35. def partitionRelations(t: scala.reflect.macros.blackbox.Context.Type, fields: List[scala.reflect.macros.Universe.TermSymbol]): (List[scala.reflect.macros.Universe.TermSymbol], List[scala.reflect.macros.Universe.TermSymbol])

    Permalink
    Definition Classes
    JsonApiCommon
  36. def partitionedCaseClassFields(t: scala.reflect.macros.blackbox.Context.Type): (List[scala.reflect.macros.Universe.TermSymbol], List[scala.reflect.macros.Universe.TermSymbol])

    Permalink
    Definition Classes
    JsonApiCommon
  37. val polyToManyType: scala.reflect.macros.Universe.Type

    Permalink
    Definition Classes
    JsonApiCommon
  38. val polyToOneType: scala.reflect.macros.Universe.Type

    Permalink
    Definition Classes
    JsonApiCommon
  39. def primaryDataWriter(t: scala.reflect.macros.blackbox.Context.Type, objName: scala.reflect.macros.Universe.TermName): scala.reflect.macros.blackbox.Context.Tree

    Permalink
    Definition Classes
    JsonApiWriters
  40. def reader(t: scala.reflect.macros.blackbox.Context.Type, primaryJsonTerm: scala.reflect.macros.Universe.TermName, includedJsonTerm: scala.reflect.macros.Universe.TermName, includePaths: scala.reflect.macros.Universe.TermName, includePath: scala.reflect.macros.Universe.TermName): scala.reflect.macros.blackbox.Context.Tree

    Permalink
    Definition Classes
    JsonApiReaders
  41. def relationFields(t: scala.reflect.macros.blackbox.Context.Type): List[scala.reflect.macros.Universe.TermSymbol]

    Permalink
    Definition Classes
    JsonApiCommon
  42. def relationshipTypes(t: scala.reflect.macros.blackbox.Context.Type): List[(scala.reflect.macros.Universe.Type, String)]

    Permalink
    Definition Classes
    JsonApiCommon
  43. def resolveContainedAttributeType(t: scala.reflect.macros.blackbox.Context.Type): scala.reflect.macros.blackbox.Context.Type

    Permalink
    Definition Classes
    JsonApiCommon
  44. def resolveContainedType(t: scala.reflect.macros.blackbox.Context.Type): scala.reflect.macros.blackbox.Context.Type

    Permalink
    Definition Classes
    JsonApiCommon
  45. def resourceType(t: scala.reflect.macros.blackbox.Context.Type): scala.reflect.macros.blackbox.Context.Tree

    Permalink
    Definition Classes
    JsonApiCommon
  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  47. val toManyType: scala.reflect.macros.Universe.Type

    Permalink
    Definition Classes
    JsonApiCommon
  48. val toOneType: scala.reflect.macros.Universe.Type

    Permalink
    Definition Classes
    JsonApiCommon
  49. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  50. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from JsonApiReaders

Inherited from JsonApiWriters

Inherited from JsonApiCommon

Inherited from Tools

Inherited from AnyRef

Inherited from Any

Ungrouped