Generators
Type members
Inherited classlikes
Stores information from what pieces Out
is made
Stores information from what pieces Out
is made
- Inherited from:
- SumCaseGeneration
Final platform-independent result of matching inputs with outputs using resolved strategies
Final platform-independent result of matching inputs with outputs using resolved strategies
- Inherited from:
- SumCaseGeneration
Translation strategy for a particular input subtype
Translation strategy for a particular input subtype
- Inherited from:
- SumCaseGeneration
Value generation strategy for a particular output parameter/setter
Value generation strategy for a particular output parameter/setter
- Inherited from:
- ProductCaseGeneration
Final platform-independent result of matching inputs with outputs using resolved strategies
Final platform-independent result of matching inputs with outputs using resolved strategies
- Inherited from:
- ProductCaseGeneration
Stores information how each attribute/getter could be extracted from In
value
Stores information how each attribute/getter could be extracted from In
value
- Inherited from:
- ProductCaseGeneration
Stores information how Out
value could be constructed from values of constructor parameters/passed to setters
Stores information how Out
value could be constructed from values of constructor parameters/passed to setters
- Inherited from:
- ProductCaseGeneration
Inherited types
Should create Out
expression from the constructor arguments grouped in parameter lists
Should create Out
expression from the constructor arguments grouped in parameter lists
- Inherited from:
- ProductCaseGeneration
Value members
Abstract methods
Should generate code pipeDerivation.lift { (in, ctx) => ... }
Should generate code pipeDerivation.lift { (in, ctx) => ... }
Should generate code pipeDerivation.mergeResults(ctx, ra, rb, (a, b) => ...)
Should generate code pipeDerivation.mergeResults(ctx, ra, rb, (a, b) => ...)
Should use platform-specific way of reporting information from macro on INFO level
Should use platform-specific way of reporting information from macro on INFO level
Should use platform-specific way of reporting errors from macro
Should use platform-specific way of reporting errors from macro
Should generate code pipeDerivation.unlift(pipe)(in, ctx)
Should generate code pipeDerivation.unlift(pipe)(in, ctx)
Concrete methods
Derives using Settings
parsed from PipeDerivationConfig[Pipe, In, Out]
expression
Derives using Settings
parsed from PipeDerivationConfig[Pipe, In, Out]
expression
Generate message to be displayed by macro on INFO level (if requested by config)
Generate message to be displayed by macro on INFO level (if requested by config)
Inherited methods
Check is A =:= B
in a platform-independent code
Check is A =:= B
in a platform-independent code
- Inherited from:
- SumCaseGeneration
Platform-specific way of parsing In
data
Platform-specific way of parsing In
data
Should:
- obtain a lift of subtypes OR enumeration values
- form it into
EnumData[In]
- Inherited from:
- SumCaseGeneration
Platform-specific way of parsing Out
data
Platform-specific way of parsing Out
data
Should:
- obtain a lift of subtypes OR enumeration values
- form it into
EnumData[In]
- Inherited from:
- SumCaseGeneration
Platform-specific way of parsing In
data
Platform-specific way of parsing In
data
Should:
- obtain all methods which are Scala's getters (vals, nullary defs)
- obtain all methods which are Java Bean getters (starting with is- or get-)
- for each create an
InField
factory which takesIn
argument and returnsInField
expression - form obtained collection into
ProductInData
- Inherited from:
- ProductCaseGeneration
Platform-specific way of parsing Out
data
Platform-specific way of parsing Out
data
Should:
- verify whether output is a case class, a case object or a Java Bean
- obtain respectively:
- a constructor taking all arguments
- expression containing case object value
- a default constructor and collection of setters respectively
- form obtained data into
ProductOutData
- Inherited from:
- ProductCaseGeneration
Platform-specific way of generating code from resolved information
Platform-specific way of generating code from resolved information
For subtype input should generate code like:
pipeDerivation.lift { (in: In, ctx: pipeDerivation.Context) =>
in match {
case inSubtype: In.Foo => pipeDerivation.unlift(fooPipe, inSubtype, updateContext(ctx, path))
case inSubtype: In.Bar => pipeDerivation.unlift(barPipe, inSubtype, updateContext(ctx, path))
}
}
- Inherited from:
- SumCaseGeneration
Platform-specific way of generating code from resolved information
Platform-specific way of generating code from resolved information
For case class output should generate code like:
pipeDerivation.lift { (in: In, ctx: pipeDerivation.Context) =>
pipeDerivation.mergeResult(
ctx,
pipeDerivation.mergeResult(
ctx,
pipeDerivation.pure(Array[Any](2)),
pipeDerivation.unlift(fooPipe, in.foo, pipeDerivation.updateContext(ctx, Path.root.field("foo"))),
{ (left, right) =>
left(0) = right
left
}
),
pipeDerivation.unlift(barPipe, in.bar, pipeDerivation.updateContext(ctx, Path.root.field("bar"))),
{ (left, right) =>
left(1) = right
new Out(
foo = left(0).asInstanceOf[Foo2],
bar = left(1).asInstanceOf[Bar2],
)
}
)
}
For case object output should generate code like:
pipeDerivation.lift { (in: In, ctx: pipeDerivation.Context) =>
pipeDerivation.pure(CaseObject)
}
For Java Bean should generate code like:
pipeDerivation.lift { (in: In, ctx: pipeDerivation.Context) =>
pipeDerivation.mergeResult(
ctx,
pipeDerivation.mergeResult(
ctx,
pipeDerivation.pure {
val result = new Out()
result
},
pipeDerivation.unlift(fooPipe, in.foo, pipeDerivation.updateContext(ctx, Path.root.field("foo"))),
{ (left, right) =>
left.setFoo(right)
left
}
),
pipeDerivation.unlift(barPipe, in.bar, pipeDerivation.updateContext(ctx, Path.root.field("bar"))),
{ (left, right) =>
left.setBar(right)
left
}
)
}
- Inherited from:
- ProductCaseGeneration
True iff A
is defined as case class
, is NOT abstract and has a public constructor
True iff A
is defined as case class
, is NOT abstract and has a public constructor
- Inherited from:
- ProductCaseGeneration
True iff A
is defined as case object
, and is public
True iff A
is defined as case object
, and is public
- Inherited from:
- ProductCaseGeneration
True iff A
has a (public) default constructor and at least one (public) method starting with set
True iff A
has a (public) default constructor and at least one (public) method starting with set
- Inherited from:
- ProductCaseGeneration
Whether Out
type could be constructed as "product case"
Whether Out
type could be constructed as "product case"
- Inherited from:
- ProductCaseGeneration
Whether both In
and Out
are ADTs/Java Enums
Whether both In
and Out
are ADTs/Java Enums
- Inherited from:
- SumCaseGeneration