Class

io.github.dreamylost.macros.constructorMacro

ConstructorProcessor

Related Doc: package constructorMacro

Permalink

class ConstructorProcessor extends AbstractMacroProcessor

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConstructorProcessor
  2. AbstractMacroProcessor
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ConstructorProcessor(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
  6. def checkAndGetClassDef(annottees: scala.reflect.macros.Universe.Expr[Any]*): scala.reflect.macros.Universe.ClassDef

    Permalink

    Check the class and its companion object, and return the class definition.

    Check the class and its companion object, and return the class definition.

    returns

    Return ClassDef

    Definition Classes
    AbstractMacroProcessor
  7. def classParamsIsNotPrivate(field: scala.reflect.macros.Universe.Tree): Boolean

    Permalink

    Check whether the mods of the fields has a private[this], because it cannot be used in equals method.

    Check whether the mods of the fields has a private[this], because it cannot be used in equals method.

    Definition Classes
    AbstractMacroProcessor
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  11. def evalTree[T](tree: scala.reflect.macros.Universe.Tree)(implicit arg0: scala.reflect.macros.Universe.WeakTypeTag[T]): T

    Permalink

    Eval tree.

    Eval tree.

    Definition Classes
    AbstractMacroProcessor
  12. def extractArgumentsTuple1[T](partialFunction: PartialFunction[scala.reflect.macros.Universe.Tree, (T)])(implicit arg0: scala.reflect.macros.Universe.WeakTypeTag[T]): (T)

    Permalink
    Definition Classes
    AbstractMacroProcessor
  13. def extractArgumentsTuple2[T1, T2](partialFunction: PartialFunction[scala.reflect.macros.Universe.Tree, (T1, T2)])(implicit arg0: scala.reflect.macros.Universe.WeakTypeTag[T1], arg1: scala.reflect.macros.Universe.WeakTypeTag[T2]): (T1, T2)

    Permalink
    Definition Classes
    AbstractMacroProcessor
  14. def extractArgumentsTuple4[T1, T2, T3, T4](partialFunction: PartialFunction[scala.reflect.macros.Universe.Tree, (T1, T2, T3, T4)])(implicit arg0: scala.reflect.macros.Universe.WeakTypeTag[T1], arg1: scala.reflect.macros.Universe.WeakTypeTag[T2], arg2: scala.reflect.macros.Universe.WeakTypeTag[T3], arg3: scala.reflect.macros.Universe.WeakTypeTag[T4]): (T1, T2, T3, T4)

    Permalink
    Definition Classes
    AbstractMacroProcessor
  15. def extractClassTypeParamsTypeName(tpParams: List[scala.reflect.macros.Universe.Tree]): List[scala.reflect.macros.Universe.TypeName]

    Permalink

    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.

    Definition Classes
    AbstractMacroProcessor
  16. def getApplyMethodWithCurrying(typeName: scala.reflect.macros.Universe.TypeName, fieldss: List[List[scala.reflect.macros.Universe.Tree]], classTypeParams: List[scala.reflect.macros.Universe.Tree]): scala.reflect.macros.Universe.Tree

    Permalink

    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.

    returns

    A apply method with currying.

    Definition Classes
    AbstractMacroProcessor
    Example:
    1. apply(int: Int)(j: Int)(k: Option[String])(t: Option[Long]): B3 = new B3(int)(j)(k)(t)

  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  18. def getClassMemberDefDefs(annotteeClassDefinitions: Seq[scala.reflect.macros.Universe.Tree]): Seq[scala.reflect.macros.Universe.Tree]

    Permalink

    Extract the methods belonging to the class, contains Secondary Constructor.

    Extract the methods belonging to the class, contains Secondary Constructor.

    Definition Classes
    AbstractMacroProcessor
  19. def getClassMemberValDefs(annotteeClassDefinitions: Seq[scala.reflect.macros.Universe.Tree]): Seq[scala.reflect.macros.Universe.Tree]

    Permalink

    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.

    Definition Classes
    AbstractMacroProcessor
  20. def getConstructorWithCurrying(typeName: scala.reflect.macros.Universe.TypeName, fieldss: List[List[scala.reflect.macros.Universe.Tree]], isCase: Boolean): scala.reflect.macros.Universe.Tree

    Permalink

    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.

    returns

    A constructor with currying, it not contains tpt, provide for calling method.

    Definition Classes
    AbstractMacroProcessor
    Example:
    1. TestClass12(i)(j)(k)(t)

  21. def getFieldAssignExprs(annotteeClassParams: Seq[scala.reflect.macros.Universe.Tree]): Seq[scala.reflect.macros.Universe.Tree]

    Permalink

    Expand the constructor and get the field with assign.

    Expand the constructor and get the field with assign.

    Definition Classes
    AbstractMacroProcessor
  22. def getFieldTermName(field: scala.reflect.macros.Universe.Tree): scala.reflect.macros.Universe.TermName

    Permalink

    Expand the constructor and get the field TermName.

    Expand the constructor and get the field TermName.

    Definition Classes
    AbstractMacroProcessor
  23. def getMethodParamName(field: scala.reflect.macros.Universe.Tree): scala.reflect.macros.Universe.Name

    Permalink

    Expand the method params and get the param Name.

    Expand the method params and get the param Name.

    Definition Classes
    AbstractMacroProcessor
  24. def handleWithImplType(annottees: scala.reflect.macros.Universe.Expr[Any]*)(modifyAction: (scala.reflect.macros.Universe.ClassDef, Option[scala.reflect.macros.Universe.ModuleDef]) ⇒ Any): scala.reflect.macros.Universe.Expr[Nothing]

    Permalink

    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.

    modifyAction

    The actual processing function

    returns

    Return the result of modifyAction

    Definition Classes
    AbstractMacroProcessor
  25. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  26. def impl(annottees: scala.reflect.macros.Universe.Expr[Any]*): scala.reflect.macros.Universe.Expr[Any]

    Permalink

    Subclasses must override the method.

    Subclasses must override the method.

    returns

    Macro expanded final syntax tree.

    Definition Classes
    ConstructorProcessorAbstractMacroProcessor
  27. def isCaseClass(annotateeClass: scala.reflect.macros.Universe.ClassDef): Boolean

    Permalink

    Expand the class and check whether the class is a case class.

    Expand the class and check whether the class is a case class.

    annotateeClass

    classDef

    returns

    Return true if it is a case class

    Definition Classes
    AbstractMacroProcessor
  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. def modifiedCompanion(compDeclOpt: Option[scala.reflect.macros.Universe.ModuleDef], codeBlock: scala.reflect.macros.Universe.Tree, className: scala.reflect.macros.Universe.TypeName): scala.reflect.macros.Universe.Tree

    Permalink

    Modify companion objects.

    Modify companion objects.

    Definition Classes
    AbstractMacroProcessor
  30. def modifiedDeclaration(classDecl: scala.reflect.macros.Universe.ClassDef, compDeclOpt: Option[scala.reflect.macros.Universe.ModuleDef] = None): Any

    Permalink

    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. When the macro implementation is very simple, we don't need to use this method, so we don't need to implement it. When there are many macro input parameters, we will not use this method temporarily because we need to pass parameters.

    returns

    c.Expr[Any], Why use Any? The dependent type need aux-pattern in scala2. Now let's get around this.

    Definition Classes
    ConstructorProcessorAbstractMacroProcessor
  31. final def ne(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  33. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  34. def printTree(force: Boolean, resTree: scala.reflect.macros.Universe.Tree): Unit

    Permalink

    Output ast result.

    Output ast result.

    Definition Classes
    AbstractMacroProcessor
  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  36. def toScalaType(jType: String): String

    Permalink

    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.

    jType

    java type name

    returns

    Scala type name

    Definition Classes
    AbstractMacroProcessor
  37. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  38. def treeResultWithCompanionObject(resTree: scala.reflect.macros.Universe.Tree, annottees: scala.reflect.macros.Universe.Expr[Any]*): scala.reflect.macros.Universe.Tree

    Permalink

    Wrap tree result with companion object.

    Wrap tree result with companion object.

    resTree

    class

    Definition Classes
    AbstractMacroProcessor
  39. def tryGetCompanionObject(annottees: scala.reflect.macros.Universe.Expr[Any]*): Option[scala.reflect.macros.Universe.ModuleDef]

    Permalink

    Get companion object if it exists.

    Get companion object if it exists.

    Definition Classes
    AbstractMacroProcessor
  40. final def wait(arg0: Long, arg1: Int): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(): Unit

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

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AbstractMacroProcessor

Inherited from AnyRef

Inherited from Any

Ungrouped