Class ExecutableMethodWriter

All Implemented Interfaces:
ClassOutputWriter, OriginatingElements, org.objectweb.asm.Opcodes

@Internal public class ExecutableMethodWriter extends AbstractAnnotationMetadataWriter implements org.objectweb.asm.Opcodes
Writes out ExecutableMethod implementations.
Since:
1.0
Author:
Graeme Rocher
  • Field Details

    • METHOD_INVOKE_INTERNAL

      public static final org.objectweb.asm.commons.Method METHOD_INVOKE_INTERNAL
    • METHOD_IS_ABSTRACT

      protected static final org.objectweb.asm.commons.Method METHOD_IS_ABSTRACT
    • METHOD_IS_SUSPEND

      protected static final org.objectweb.asm.commons.Method METHOD_IS_SUSPEND
    • METHOD_GET_TARGET

      protected static final org.objectweb.asm.commons.Method METHOD_GET_TARGET
    • methodType

      protected final org.objectweb.asm.Type methodType
  • Constructor Details

    • ExecutableMethodWriter

      public ExecutableMethodWriter(String methodClassName, boolean isInterface, boolean isAbstract, boolean isDefault, boolean isSuspend, OriginatingElements originatingElements, AnnotationMetadata annotationMetadata, String interceptedProxyClassName, String interceptedProxyBridgeMethodName)
      Parameters:
      methodClassName - The method class name
      isInterface - Whether is an interface
      isAbstract - Whether the method is abstract
      isDefault - Whether the method is a default method
      isSuspend - Whether the method is Kotlin suspend function
      originatingElements - The originating elements
      annotationMetadata - The annotation metadata
      interceptedProxyClassName - The intercepted proxy class name
      interceptedProxyBridgeMethodName - The intercepted proxy bridge method name
  • Method Details

    • isSupportsInterceptedProxy

      public boolean isSupportsInterceptedProxy()
      Returns:
      Is supports intercepted proxy.
    • isAbstract

      public boolean isAbstract()
      Returns:
      Is the method abstract.
    • isInterface

      public boolean isInterface()
      Returns:
      Is the method in an interface.
    • isDefault

      public boolean isDefault()
      Returns:
      Is the method a default method.
    • isSuspend

      public boolean isSuspend()
      Returns:
      Is the method suspend.
    • getClassName

      public String getClassName()
      Returns:
      The class name
    • getInternalName

      public String getInternalName()
      Returns:
      The internal name
    • visitMethod

      public void visitMethod(TypedElement declaringType, MethodElement methodElement)
      Write the method.
      Parameters:
      declaringType - The declaring type
      methodElement - The method element
    • accept

      public void accept(ClassWriterOutputVisitor classWriterOutputVisitor) throws IOException
      Description copied from interface: ClassOutputWriter
      Accept a ClassWriterOutputVisitor to write this writer to disk.
      Specified by:
      accept in interface ClassOutputWriter
      Parameters:
      classWriterOutputVisitor - The ClassWriterOutputVisitor
      Throws:
      IOException - if there is an error writing to disk
    • beginAnnotationMetadataMethod

      @NonNull protected final org.objectweb.asm.commons.GeneratorAdapter beginAnnotationMetadataMethod(org.objectweb.asm.ClassWriter classWriter)
      Description copied from class: AbstractAnnotationMetadataWriter
      Returns the generator adaptor for the method that resolves the annotation metadata.
      Overrides:
      beginAnnotationMetadataMethod in class AbstractAnnotationMetadataWriter
      Parameters:
      classWriter - The class writer
      Returns:
      The generator adapter
    • buildInvokeMethod

      protected void buildInvokeMethod(org.objectweb.asm.Type declaringTypeObject, String methodName, ClassElement returnType, Collection<ParameterElement> argumentTypes, org.objectweb.asm.commons.GeneratorAdapter invokeMethodVisitor)
      Parameters:
      declaringTypeObject - The declaring object type
      methodName - The method name
      returnType - The return type
      argumentTypes - The argument types
      invokeMethodVisitor - The invoke method visitor