Class ProxettaMethodBuilder

    • Field Detail

      • TARGET_CLASS_NAME

        public static final java.lang.String TARGET_CLASS_NAME
      • aspectList

        protected final java.util.List<jodd.proxetta.asm.ProxyAspectData> aspectList
      • tmd

        protected jodd.proxetta.asm.TargetMethodData tmd
      • proxyInfoRequested

        protected boolean proxyInfoRequested
    • Constructor Detail

      • ProxettaMethodBuilder

        public ProxettaMethodBuilder​(MethodSignatureVisitor msign,
                                     WorkData wd,
                                     java.util.List<jodd.proxetta.asm.ProxyAspectData> aspectList)
    • Method Detail

      • visitAnnotation

        public AnnotationVisitor visitAnnotation​(java.lang.String desc,
                                                 boolean visible)
        Copies target method annotations.
        Overrides:
        visitAnnotation in class MethodVisitor
        Parameters:
        desc - the class descriptor of the annotation class.
        visible - true if the annotation is visible at runtime.
        Returns:
        a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.
      • visitAnnotationDefault

        public AnnotationVisitor visitAnnotationDefault()
        Description copied from class: MethodVisitor
        Visits the default value of this annotation interface method.
        Overrides:
        visitAnnotationDefault in class MethodVisitor
        Returns:
        a visitor to the visit the actual default value of this annotation interface method, or null if this visitor is not interested in visiting this default value. The 'name' parameters passed to the methods of this annotation visitor are ignored. Moreover, exacly one visit method must be called on this annotation visitor, followed by visitEnd.
      • visitParameterAnnotation

        public AnnotationVisitor visitParameterAnnotation​(int parameter,
                                                          java.lang.String desc,
                                                          boolean visible)
        Description copied from class: MethodVisitor
        Visits an annotation of a parameter this method.
        Overrides:
        visitParameterAnnotation in class MethodVisitor
        Parameters:
        parameter - the parameter index. This index must be strictly smaller than the number of parameters in the method descriptor, and strictly smaller than the parameter count specified in MethodVisitor.visitAnnotableParameterCount(int, boolean). Important note: a parameter index i is not required to correspond to the i'th parameter descriptor in the method descriptor, in particular in case of synthetic parameters (see https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.18).
        desc - the class descriptor of the annotation class.
        visible - true if the annotation is visible at runtime.
        Returns:
        a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.
      • visitEnd

        public void visitEnd()
        Finally, builds proxy methods if applied to current method.
        Overrides:
        visitEnd in class MethodVisitor
      • createFirstChainDelegate_Start

        protected void createFirstChainDelegate_Start()
        Starts creation of first chain delegate.
      • createFirstChainDelegate_Continue

        protected void createFirstChainDelegate_Continue​(jodd.proxetta.asm.TargetMethodData tmd)
        Continues the creation of the very first method in calling chain that simply delegates invocation to the first proxy method. This method mirrors the target method.
      • createProxyMethod

        public void createProxyMethod​(jodd.proxetta.asm.TargetMethodData td)
        Creates proxy methods over target method, For each matched proxy, new proxy method is created by taking advice bytecode and replaces usages of ProxyTarget.

        Invocation chain example: name -> name$p0 -> name$p1 -> name$p4 -> super.