package annotations
- Alphabetic
- By Inheritance
- annotations
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
macro
class
component[M] extends Annotation with StaticAnnotation
macro annotation to mark a class as a persistent component.
macro annotation to mark a class as a persistent component. creates a companion object for the class that extends CType. if the class already has a companion object, then adds a parent class
CType
to the existing companion object. Note that this will not work if your companion object already extends an abstract or concrete class, asCType
itself is an abstract class. if this happens, you will see a compiler error such as "class Foo needs to be a trait to be mixed in".- M
the model
- Annotations
- @compileTimeOnly( ... )
-
macro
class
derivedComponent[M, Poly] extends Annotation with StaticAnnotation
macro annotation to mark a class or object as a derived persistent component.
macro annotation to mark a class or object as a derived persistent component. creates a companion object for the class that extends DerivedCType. if the class already has a companion object, then adds a parent class
DerivedCType
to the existing companion object. Note that this will not work if your companion object already extends an abstract or concrete class, asDerivedCType
itself is an abstract class. if this happens, you will see a compiler error such as "class Foo needs to be a trait to be mixed in".if the annotated component is already an object, we create the
DerivedCType
as an internalobject ctype
.- M
the model
- Poly
the type of the polymorphic component that this component is derived from
- Annotations
- @compileTimeOnly( ... )
-
macro
class
derivedPersistent[M, Poly] extends Annotation with StaticAnnotation
macro annotation to mark a class as a derived persistent component.
macro annotation to mark a class as a derived persistent component. creates a companion object for the class that extends DerivedPType. if the class already has a companion object, then adds a parent class
DerivedPType
to the existing companion object.Note that, when using this annotation, an existing companion object cannot already extend a class other than
DerivedPType
orscala.AnyRef
.- M
the model
- Poly
the type of the polymorphic persistent that this persistent is derived from
- Annotations
- @compileTimeOnly( ... )
-
macro
class
domainModel extends Annotation with StaticAnnotation
macro annotation to mark a class or trait as a domain model.
macro annotation to mark a class or trait as a domain model. adds two elements to the companion object of the annotated class:
-
implicit object modelType extends longevity.model.ModelType[M](currentPackage)
, -private[currentPackage] implicit object modelEv extends longevity.model.ModelEv[M]
where
M
is the annotated class, andcurrentPackage
is the package in which this annotation was applied.- Annotations
- @compileTimeOnly( ... )
- See also
longevity.model.ModelType
longevity.model.ModelEv
-
macro
class
keyVal[M, P] extends Annotation with StaticAnnotation
macro annotation to mark a class as a key value.
macro annotation to mark a class as a key value. extends the class with
longevity.model.KeyVal[P]
.- M
the domain model
- P
the persistent object that this type serves as a key value for
- Annotations
- @compileTimeOnly( ... )
-
macro
class
mprops extends Annotation with StaticAnnotation
macro annotation to generate a inner object
props
for yourPType
for you.macro annotation to generate a inner object
props
for yourPType
for you. Recursive members of the typeP
inPType[P]
are mirrored in a structure of nested objects with typeProp[P, A](path)
for appropriate valuesA
andpath
.- case classes are traversed according to the parameters of their primary constructor - collection properties (
Options
,Sets
, andLists
) are skipped - traits are traversed according to the abstract public vals they define. the traits themselves, however, are not mirrored as aProp[P, A]
NOTE: this traversal process will collect all valid properties for your
PType
. but be aware that the traversal can collect properties that are not actually valid. for example, it will freely traverse case class elements that appear to be persistent components, but are not included in your ModelType. it will also traverse persistent components that are otherwise illegal, such as those whose primary constructor has more than one parameter list. in all these cases, the property created by this macro will cause an exception to be thrown on model type construction. but all these cases, which represent a malformed domain model, would have otherwise produced exceptions on model type construction.- Annotations
- @compileTimeOnly( ... )
-
macro
class
pEv extends Annotation with StaticAnnotation
macro annotation to generate a concrete definition of
PType.pEv
for you.macro annotation to generate a concrete definition of
PType.pEv
for you. This is roughly built as follows:implicit val pEv: longevity.model.PEv[M, P] = { import org.scalacheck.ScalacheckShapeless._ implicit val arbJoda = com.fortysevendeg.scalacheck.datetime.joda.ArbitraryJoda.arbJoda new longevity.model.PEv[M, P] }
- Annotations
- @compileTimeOnly( ... )
-
macro
class
persistent[M] extends Annotation with StaticAnnotation
macro annotation to mark a class as a persistent component.
macro annotation to mark a class as a persistent component. creates a companion object for the class that extends PType. if the class already has a companion object, then adds a parent class
PType
to the existing companion object.Note that, when using this annotation, an existing companion object cannot already extend a class other than
PType
orscala.AnyRef
.- M
the model
- Annotations
- @compileTimeOnly( ... )
-
macro
class
polyComponent[M] extends Annotation with StaticAnnotation
macro annotation to mark a trait as a polymorphic persistent component.
macro annotation to mark a trait as a polymorphic persistent component. creates a companion object for the trait that extends PolyCType. if the trait already has a companion object, then adds a parent class
PolyCType
to the existing companion object. Note that this will not work if your companion object already extends an abstract or concrete class, asPolyCType
itself is an abstract class.- M
the model
- Annotations
- @compileTimeOnly( ... )
-
macro
class
polyPersistent[M] extends Annotation with StaticAnnotation
macro annotation to mark a trait as a polymorphic persistent component.
macro annotation to mark a trait as a polymorphic persistent component. creates a companion object for the class that extends PolyPType. if the class already has a companion object, then adds a parent class
PolyPType
to the existing companion object.Note that, when using this annotation, an existing companion object cannot already extend a class other than
PolyPType
orscala.AnyRef
.- M
the model
- Annotations
- @compileTimeOnly( ... )
Value Members
-
macro
def
packscanToList[A]: List[A]
gathers all the
A
s in the same package as the macro was called into a list.gathers all the
A
s in the same package as the macro was called into a list.this def macro is used by the
@domainModel
annotation macro to gather all thePTypes
andCTypes
together to construct theModelType
. it is a little out of place in a package namedlongevity.model.annotations
, but it does not seem appropriate to create a new project or package to contain a single def macro.- See also
domainModel
longevity,model.PType
longevity,model.CType
longevity,model.ModelType