Generate the specified syntax tree and assign it to the tree definition itself.
Generate the specified syntax tree and assign it to the tree definition itself. Used only when you modify the definition of the class itself. Such as add method/add field.
Content body added in class definition
Return a new scala.reflect.api.Trees#ClassDef
Modify companion object or object.
Modify companion object or object.
Return a scala.reflect.api.Trees#ModuleDef which was appended codeblocks, ModuleDef may already exist or may be newly created
Check the input tree of the annotation.
Check the input tree of the annotation.
Check the class and its companion object, and return the class definition.
Check the class and its companion object, and return the class definition.
Return a scala.reflect.api.Trees#ClassDef
Modify the associated object itself according to whether there is an associated object.
Modify the associated object itself according to whether there is an associated object.
The actual processing function
Return the result of modifyAction function
Subclasses should override the method and return the final result abstract syntax tree, or an abstract syntax tree close to the final result.
Subclasses should override the method and return the final result abstract syntax tree, or an abstract syntax tree close to the final result.
c.Expr[Any]
, Why use Any? The dependent type need aux-pattern in scala2. Now let's get around this.
Eval the input tree.
Eval the input tree.
Is there a parent class? Does not contains sdk class, such as AnyRef and Object.
Is there a parent class? Does not contains sdk class, such as AnyRef and Object.
Return true if there is a non-SDK super class
Gets a list of generic parameters.
Gets a list of generic parameters. This is because the generic parameters of a class cannot be used directly in the return type, and need to be converted.
Return a sequence of scala.reflect.api.Names#TypeName
Find the specified val Name in the enclosingClass definition.
Find the specified val Name in the enclosingClass definition.
Return a optional scala.reflect.api.Names#TermName
We generate apply method with currying, and we have to deal with the first layer of currying alone.
We generate apply method with currying, and we have to deal with the first layer of currying alone.
A apply method with currying.
Return a tree, such as def apply(int: Int)(j: Int)(k: Option[String])(t: Option[Long]): B3 = new B3(int)(j)(k)(t)
Extract the constructor params ValDef and flatten for currying.
Extract the constructor params ValDef and flatten for currying.
Return a sequence of scala.reflect.api.Trees#ValDef
Extract the constructor params scala.reflect.api.Trees#ValDef not flatten.
Extract the constructor params scala.reflect.api.Trees#ValDef not flatten.
Return a double sequence of scala.reflect.api.Trees#ValDef
Extract the methods belonging to the class, contains Secondary Constructor.
Extract the methods belonging to the class, contains Secondary Constructor.
Return a sequence of scala.reflect.api.Trees#DefDef
Extract the internal fields of members belonging to the class, but not in primary constructor.
Extract the internal fields of members belonging to the class, but not in primary constructor.
Return a sequence of scala.reflect.api.Trees#ValDef
Get the field TermName with type.
Get the field TermName with type.
Return a sequence of scala.reflect.api.Trees#Tree, each one is tname: tpt
We generate constructor with currying, and we have to deal with the first layer of currying alone.
We generate constructor with currying, and we have to deal with the first layer of currying alone.
A constructor with currying, it not contains tpt, provide for calling method.
Return a tree, such as new TestClass12(i)(j)(k)(t)
Get object if it exists.
Get object if it exists.
Return a optional scala.reflect.api.Trees#ModuleDef
Subclasses should override this method if it cannot use createCustomExpr method.
Subclasses should override this method if it cannot use createCustomExpr method.
Return a macro expanded final syntax tree.
Check whether the class is a case class.
Check whether the class is a case class.
classDef
Return true if it is a case class
Check whether the mods of the fields has a private[this]
or protected[this]
, because it cannot be used out of class.
Check whether the mods of the fields has a private[this]
or protected[this]
, because it cannot be used out of class.
Tree is a field or method?
Return false if mods exists private[this]
or protected[this]
Extract the necessary structure information of the class for macro programming.
Extract the necessary structure information of the class for macro programming.
Return the expansion of the class definition as org.bitlap.tools.macros.AbstractMacroProcessor#ClassDefinition
Modify the method body of the method tree.
Modify the method body of the method tree.
Method body of final result
Return a new scala.reflect.api.Trees#DefDef which changed by defBodyAction function
Extract the necessary structure information of the moduleDef for macro programming.
Extract the necessary structure information of the moduleDef for macro programming.
Return the expansion of the class definition as org.bitlap.tools.macros.AbstractMacroProcessor#ClassDefinition
Output ast result.
Output ast result.
Only for primitive types, we can get type and map to scala type.
Only for primitive types, we can get type and map to scala type.
java type name
Scala type name
Retrieves the accessor fields on a class and returns a Seq of org.bitlap.tools.macros.AbstractMacroProcessor#ValDefAccessor.
Retrieves the accessor fields on a class and returns a Seq of org.bitlap.tools.macros.AbstractMacroProcessor#ValDefAccessor.
The list of params retrieved from the class
Return a sequence of org.bitlap.tools.macros.AbstractMacroProcessor#ValDefAccessor
(Since version ) see corresponding Javadoc for more information.