Class TypeWriter.MethodPool.Record.ForDefinedMethod.WithoutBody

    • Field Detail

      • methodDescription

        private final MethodDescription methodDescription
        The implemented method.
      • methodAttributeAppender

        private final MethodAttributeAppender methodAttributeAppender
        The method attribute appender to apply.
      • visibility

        private final Visibility visibility
        The represented method's minimum visibility.
    • Constructor Detail

      • WithoutBody

        public WithoutBody​(MethodDescription methodDescription,
                           MethodAttributeAppender methodAttributeAppender,
                           Visibility visibility)
        Creates a new entry for a method that is defines but does not append byte code, i.e. is native or abstract.
        Parameters:
        methodDescription - The implemented method.
        methodAttributeAppender - The method attribute appender to apply.
        visibility - The represented method's minimum visibility.
    • Method Detail

      • getVisibility

        public Visibility getVisibility()
        The visibility to enforce for this method.
        Returns:
        The visibility to enforce for this method.
      • applyHead

        public void applyHead​(org.objectweb.asm.MethodVisitor methodVisitor)
        Applies the head of this entry. Applying an entry is only possible if a method is defined, i.e. the sort of this entry is not TypeWriter.MethodPool.Record.Sort.SKIPPED.
        Parameters:
        methodVisitor - The method visitor to which this entry should be applied.
      • applyBody

        public void applyBody​(org.objectweb.asm.MethodVisitor methodVisitor,
                              Implementation.Context implementationContext,
                              AnnotationValueFilter.Factory annotationValueFilterFactory)
        Applies the body of this entry. Applying the body of an entry is only possible if a method is implemented, i.e. the sort of this entry is TypeWriter.MethodPool.Record.Sort.IMPLEMENTED.
        Parameters:
        methodVisitor - The method visitor to which this entry should be applied.
        implementationContext - The implementation context to which this entry should be applied.
        annotationValueFilterFactory - The annotation value filter factory to apply when writing annotations.
      • applyAttributes

        public void applyAttributes​(org.objectweb.asm.MethodVisitor methodVisitor,
                                    AnnotationValueFilter.Factory annotationValueFilterFactory)
        Applies the attributes of this entry. Applying the body of an entry is only possible if a method is implemented, i.e. the sort of this entry is TypeWriter.MethodPool.Record.Sort.DEFINED.
        Parameters:
        methodVisitor - The method visitor to which this entry should be applied.
        annotationValueFilterFactory - The annotation value filter factory to apply when writing annotations.
      • applyCode

        public ByteCodeAppender.Size applyCode​(org.objectweb.asm.MethodVisitor methodVisitor,
                                               Implementation.Context implementationContext)
        Applies the code of this entry. Applying the body of an entry is only possible if a method is implemented, i.e. the sort of this entry is TypeWriter.MethodPool.Record.Sort.IMPLEMENTED.
        Parameters:
        methodVisitor - The method visitor to which this entry should be applied.
        implementationContext - The implementation context to which this entry should be applied.
        Returns:
        The size requirements of the implemented code.
      • prepend

        public TypeWriter.MethodPool.Record prepend​(ByteCodeAppender byteCodeAppender)
        Prepends the given method appender to this entry.
        Parameters:
        byteCodeAppender - The byte code appender to prepend.
        Returns:
        This entry with the given code prepended.