Top Description Inners Fields Constructors Methods
net.bytebuddy.implementation.auxiliary

public Class TypeProxy

extends Object
implements AuxiliaryType
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.auxiliary.AuxiliaryType
Annotations
@Enhance
Imports
net.bytebuddy.ByteBuddy, .ClassFileVersion, net.bytebuddy.build.HashCodeAndEqualsPlugin, net.bytebuddy.description.field.FieldDescription, net.bytebuddy.description.method.MethodDescription, net.bytebuddy.description.modifier.Ownership, net.bytebuddy.description.type.TypeDescription, net.bytebuddy.dynamic.DynamicType, .TargetType, net.bytebuddy.dynamic.scaffold.InstrumentedType, .TypeValidation, net.bytebuddy.implementation.Implementation, .MethodAccessorFactory, net.bytebuddy.implementation.bytecode.*, net.bytebuddy.implementation.bytecode.constant.DefaultValue, net.bytebuddy.implementation.bytecode.member.FieldAccess, .MethodInvocation, .MethodReturn, .MethodVariableAccess, net.bytebuddy.matcher.ElementMatchers, net.bytebuddy.utility.RandomString, net.bytebuddy.jar.asm.MethodVisitor, .Opcodes, .Type, java.io.Serializable, java.util.List

A type proxy creates accessor methods for all overridable methods of a given type by subclassing the given type and delegating all method calls to accessor methods of the instrumented type it was created for.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static enum
TypeProxy.AbstractMethodErrorThrow

A stack manipulation that throws an abstract method error in case that a given super method cannot be invoked.

public static class
TypeProxy.ForDefaultMethod

Creates a type proxy which delegates its super method calls to any invokable default method of a given interface and loads an instance of this proxy onto the operand stack.

public static class
TypeProxy.ForSuperMethodByConstructor

Loads a type proxy onto the operand stack which is created by calling one of its constructors.

public static class
TypeProxy.ForSuperMethodByReflectionFactory

Loads a type proxy onto the operand stack which is created by constructing a serialization constructor using the Oracle JDK's sun.reflect.ReflectionFactory#newConstructorForSerialization(Class, java.lang.reflect.Constructor) method which might not be available in any Java runtime.

public static interface
TypeProxy.InvocationFactory

An invocation factory is responsible for creating a special method invocation for any method that is to be invoked.

protected class
protected static enum
TypeProxy.SilentConstruction

An implementation of a silent construction of a given type by using the non-standardized sun.reflect.ReflectionFactory.

Field Summary

Modifier and TypeField and Description
private final boolean
ignoreFinalizer

true if the finalizer method should not be instrumented.

private final Implementation.Target
implementationTarget

The implementation target of the proxied type.

public static final String
INSTANCE_FIELD

The name of the field that stores the delegation instance.

private final TypeProxy.InvocationFactory
invocationFactory

The invocation factory for creating special method invocations.

private final TypeDescription
proxiedType

The type that is proxied, i.e. the original instrumented type this proxy is created for.

public static final String
REFLECTION_METHOD

The name of the static method that is added to this auxiliary type for creating instances by using the Oracle JDK's sun.reflect.ReflectionFactory.

private final boolean
serializableProxy

Determines if the proxy should be serializable.

Constructor Summary

AccessConstructor and Description
public
TypeProxy(TypeDescription
The type this proxy should implement which can either be a non-final class or an interface.
proxiedType
,
Implementation.Target
The implementation target this type proxy is created for.
implementationTarget
,
TypeProxy.InvocationFactory
The invocation factory for creating special method invocations.
invocationFactory
,
boolean
true if any finalizer methods should be ignored for proxying.
ignoreFinalizer
,
boolean
Determines if the proxy should be serializable.
serializableProxy
)

Creates a new type proxy.

Method Summary

Modifier and TypeMethod and Description
public String
getSuffix()

Implements net.bytebuddy.implementation.auxiliary.AuxiliaryType.getSuffix.

Produces a suffix that gives this auxiliary type a stable name.
public DynamicType
make(String
The fully qualified binary name for this auxiliary type. The type should be in the same package than the instrumented type this auxiliary type is providing services to in order to allow package-private access.
auxiliaryTypeName
,
ClassFileVersion
The class file version the auxiliary class should be written in.
classFileVersion
,
MethodAccessorFactory
A factory for accessor methods.
methodAccessorFactory
)

Implements net.bytebuddy.implementation.auxiliary.AuxiliaryType.make.

Creates a new auxiliary type.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait