Top Description Inners Fields Constructors Methods
net.bytebuddy.implementation

public final Enum SuperMethodCall

extends Enum<SuperMethodCall>
implements Composable
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.Implementation.Composable, net.bytebuddy.implementation.Implementation, net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
Imports
net.bytebuddy.build.HashCodeAndEqualsPlugin, net.bytebuddy.description.method.MethodDescription, net.bytebuddy.dynamic.scaffold.InstrumentedType, net.bytebuddy.implementation.bytecode.ByteCodeAppender, .Removal, .StackManipulation, net.bytebuddy.implementation.bytecode.member.MethodReturn, .MethodVariableAccess, net.bytebuddy.jar.asm.MethodVisitor

This implementation will create a new method which simply calls its super method. If no such method is defined, an exception will be thrown. Constructors are considered to have a super method if the direct super class defines a constructor with an identical signature. Default methods are invoked as such if they are non-ambiguous. Static methods can have a (pseudo) super method if a type that defines such a method is rebased. Rebased types can also shadow constructors or methods of an actual super class. Besides implementing constructors, this implementation is useful when a method of a super type is not supposed to be altered but should be equipped with additional annotations. Furthermore, this implementation allows to hard code a super method call to be performed after performing another Implementation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
protected static enum
SuperMethodCall.WithoutReturn

A super method invocation where the return value is dropped instead of returning from the method.

Field Summary

Modifier and TypeField and Description
public static final SuperMethodCall
INSTANCE

The singleton instance.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Implementation
andThen(Implementation
The subsequent implementation.
implementation
)

Implements net.bytebuddy.implementation.Implementation.Composable.andThen.

Appends the supplied implementation to this implementation.
public Implementation.Composable
andThen(Implementation.Composable
The subsequent composable implementation.
implementation
)

Implements net.bytebuddy.implementation.Implementation.Composable.andThen.

Appends the supplied composable implementation to this implementation.
public ByteCodeAppender
appender(Implementation.Target
The target of the current implementation.
implementationTarget
)

Implements net.bytebuddy.implementation.Implementation.appender.

Creates a byte code appender that determines the implementation of the instrumented type's methods.
public InstrumentedType
prepare(InstrumentedType
The instrumented type in its current form.
instrumentedType
)

Implements net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable.prepare.

Prepares a given instrumented type.
public static SuperMethodCall
public static SuperMethodCall[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final SuperMethodCall INSTANCE

The singleton instance.

Constructor Detail

SuperMethodCallback to summary
private SuperMethodCall()

Method Detail

andThenback to summary
public Implementation andThen(Implementation implementation)

Implements net.bytebuddy.implementation.Implementation.Composable.andThen.

Doc from net.bytebuddy.implementation.Implementation.Composable.andThen.

Appends the supplied implementation to this implementation.

Parameters
implementation:Implementation

The subsequent implementation.

Returns:Implementation

An implementation that combines this implementation with the provided one.

andThenback to summary
public Implementation.Composable andThen(Implementation.Composable implementation)

Implements net.bytebuddy.implementation.Implementation.Composable.andThen.

Doc from net.bytebuddy.implementation.Implementation.Composable.andThen.

Appends the supplied composable implementation to this implementation.

Parameters
implementation:Implementation.Composable

The subsequent composable implementation.

Returns:Implementation.Composable

A composable implementation that combines this implementation with the provided one.

appenderback to summary
public ByteCodeAppender appender(Implementation.Target implementationTarget)

Implements net.bytebuddy.implementation.Implementation.appender.

Doc from net.bytebuddy.implementation.Implementation.appender.

Creates a byte code appender that determines the implementation of the instrumented type's methods.

Parameters
implementationTarget:Implementation.Target

The target of the current implementation.

Returns:ByteCodeAppender

A byte code appender for implementing methods delegated to this implementation. This byte code appender is also responsible for handling methods that were added by this implementation on the call to Implementation#prepare(InstrumentedType).

prepareback to summary
public InstrumentedType prepare(InstrumentedType instrumentedType)

Implements net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable.prepare.

Doc from net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable.prepare.

Prepares a given instrumented type.

Parameters
instrumentedType:InstrumentedType

The instrumented type in its current form.

Returns:InstrumentedType

The prepared instrumented type.

valueOfback to summary
public static SuperMethodCall valueOf(String name)
valuesback to summary
public static SuperMethodCall[] values()
net.bytebuddy.implementation back to summary

protected Class SuperMethodCall.Appender

extends Object
implements ByteCodeAppender
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.bytecode.ByteCodeAppender
Annotations
@Enhance

An appender for implementing a net.bytebuddy.implementation.SuperMethodCall.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static enum
SuperMethodCall.Appender.TerminationHandler

A handler that determines how to handle the method return value.

Field Summary

Modifier and TypeField and Description
private final Implementation.Target
implementationTarget

The target of the current implementation.

private final SuperMethodCall.Appender.TerminationHandler
terminationHandler

The termination handler to apply after invoking the super method.

Constructor Summary

AccessConstructor and Description
protected
Appender(Implementation.Target
The implementation target of the current type creation.
implementationTarget
,
SuperMethodCall.Appender.TerminationHandler
The termination handler to apply after invoking the super method.
terminationHandler
)

Creates a new appender.

Method Summary

Modifier and TypeMethod and Description
public ByteCodeAppender.Size
apply(MethodVisitor
The method visitor to which the byte code appender writes its code to.
methodVisitor
,
Implementation.Context
The implementation context of the current type creation process.
implementationContext
,
MethodDescription
The method that is the target of the instrumentation.
instrumentedMethod
)

Implements net.bytebuddy.implementation.bytecode.ByteCodeAppender.apply.

Applies this byte code appender to a type creation process.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

implementationTargetback to summary
private final Implementation.Target implementationTarget

The target of the current implementation.

terminationHandlerback to summary
private final SuperMethodCall.Appender.TerminationHandler terminationHandler

The termination handler to apply after invoking the super method.

Constructor Detail

Appenderback to summary
protected Appender(Implementation.Target implementationTarget, SuperMethodCall.Appender.TerminationHandler terminationHandler)

Creates a new appender.

Parameters
implementationTarget:Implementation.Target

The implementation target of the current type creation.

terminationHandler:SuperMethodCall.Appender.TerminationHandler

The termination handler to apply after invoking the super method.

Method Detail

applyback to summary
public ByteCodeAppender.Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod)

Implements net.bytebuddy.implementation.bytecode.ByteCodeAppender.apply.

Doc from net.bytebuddy.implementation.bytecode.ByteCodeAppender.apply.

Applies this byte code appender to a type creation process.

Parameters
methodVisitor:MethodVisitor

The method visitor to which the byte code appender writes its code to.

implementationContext:Implementation.Context

The implementation context of the current type creation process.

instrumentedMethod:MethodDescription

The method that is the target of the instrumentation.

Returns:ByteCodeAppender.Size

The required size for the applied byte code to run.

net.bytebuddy.implementation back to summary

protected sealed Enum SuperMethodCall.Appender.TerminationHandler

extends Enum<SuperMethodCall.Appender.TerminationHandler>
Class Inheritance

A handler that determines how to handle the method return value.

Field Summary

Modifier and TypeField and Description
public static final SuperMethodCall.Appender.TerminationHandler
DROPPING

A termination handler that simply pops the value of the super method invocation off the stack.

public static final SuperMethodCall.Appender.TerminationHandler
RETURNING

A termination handler that returns the value of the super method invocation.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected abstract StackManipulation

Returns:

The stack manipulation that implements this handler.
of
(MethodDescription
The method for which this handler is supposed to create a stack manipulation for.
methodDescription
)

Creates a stack manipulation that represents this handler's behavior.

public static SuperMethodCall.Appender.TerminationHandler
public static SuperMethodCall.Appender.TerminationHandler[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DROPPINGback to summary
public static final SuperMethodCall.Appender.TerminationHandler DROPPING

A termination handler that simply pops the value of the super method invocation off the stack.

RETURNINGback to summary
public static final SuperMethodCall.Appender.TerminationHandler RETURNING

A termination handler that returns the value of the super method invocation.

Constructor Detail

TerminationHandlerback to summary
private TerminationHandler()

Method Detail

ofback to summary
protected abstract StackManipulation of(MethodDescription methodDescription)

Creates a stack manipulation that represents this handler's behavior.

Parameters
methodDescription:MethodDescription

The method for which this handler is supposed to create a stack manipulation for.

Returns:StackManipulation

The stack manipulation that implements this handler.

valueOfback to summary
public static SuperMethodCall.Appender.TerminationHandler valueOf(String name)
valuesback to summary
public static SuperMethodCall.Appender.TerminationHandler[] values()
net.bytebuddy.implementation back to summary

protected final Enum SuperMethodCall.WithoutReturn

extends Enum<SuperMethodCall.WithoutReturn>
implements Implementation
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.Implementation, net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable

A super method invocation where the return value is dropped instead of returning from the method.

Field Summary

Modifier and TypeField and Description
public static final SuperMethodCall.WithoutReturn
INSTANCE

The singleton instance.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public ByteCodeAppender
appender(Implementation.Target
The target of the current implementation.
implementationTarget
)

Implements net.bytebuddy.implementation.Implementation.appender.

Creates a byte code appender that determines the implementation of the instrumented type's methods.
public InstrumentedType
prepare(InstrumentedType
The instrumented type in its current form.
instrumentedType
)

Implements net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable.prepare.

Prepares a given instrumented type.
public static SuperMethodCall.WithoutReturn
public static SuperMethodCall.WithoutReturn[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final SuperMethodCall.WithoutReturn INSTANCE

The singleton instance.

Constructor Detail

WithoutReturnback to summary
private WithoutReturn()

Method Detail

appenderback to summary
public ByteCodeAppender appender(Implementation.Target implementationTarget)

Implements net.bytebuddy.implementation.Implementation.appender.

Doc from net.bytebuddy.implementation.Implementation.appender.

Creates a byte code appender that determines the implementation of the instrumented type's methods.

Parameters
implementationTarget:Implementation.Target

The target of the current implementation.

Returns:ByteCodeAppender

A byte code appender for implementing methods delegated to this implementation. This byte code appender is also responsible for handling methods that were added by this implementation on the call to Implementation#prepare(InstrumentedType).

prepareback to summary
public InstrumentedType prepare(InstrumentedType instrumentedType)

Implements net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable.prepare.

Doc from net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable.prepare.

Prepares a given instrumented type.

Parameters
instrumentedType:InstrumentedType

The instrumented type in its current form.

Returns:InstrumentedType

The prepared instrumented type.

valueOfback to summary
public static SuperMethodCall.WithoutReturn valueOf(String name)
valuesback to summary
public static SuperMethodCall.WithoutReturn[] values()