Top Description Inners Fields Constructors Methods
net.bytebuddy.implementation.bytecode.constant

public abstract Class MethodConstant

extends AbstractBase
Class Inheritance
Known Direct Subclasses
net.bytebuddy.implementation.bytecode.constant.MethodConstant.ForMethod, net.bytebuddy.implementation.bytecode.constant.MethodConstant.ForConstructor
Imports
edu.umd.cs.findbugs.annotations.SuppressFBWarnings, net.bytebuddy.description.method.MethodDescription, net.bytebuddy.description.type.TypeDescription, net.bytebuddy.implementation.Implementation, net.bytebuddy.implementation.auxiliary.PrivilegedMemberLookupAction, net.bytebuddy.implementation.bytecode.Duplication, .StackManipulation, .TypeCreation, net.bytebuddy.implementation.bytecode.assign.TypeCasting, net.bytebuddy.implementation.bytecode.collection.ArrayFactory, net.bytebuddy.implementation.bytecode.member.FieldAccess, .MethodInvocation, net.bytebuddy.utility.nullability.MaybeNull, net.bytebuddy.jar.asm.MethodVisitor, java.lang.reflect.Constructor, .Method, java.security.PrivilegedExceptionAction, java.util.ArrayList, .List

Represents the creation of a java.lang.reflect.Method value which can be created from a given set of constant pool values and can therefore be considered a constant in the broader meaning.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
protected static class
public static interface
MethodConstant.CanCache

Represents a net.bytebuddy.implementation.bytecode.constant.MethodConstant that is directly loaded onto the operand stack without caching the value.

protected static enum
MethodConstant.CanCacheIllegal

Represents a method constant that cannot be represented by Java's reflection API.

protected static class
protected static class
protected static class
MethodConstant.PrivilegedLookup

Performs a privileged lookup of a method constant by using an java.security.AccessController.

Field Summary

Modifier and TypeField and Description
protected static final MethodDescription.InDefinedShape
DO_PRIVILEGED

The java.security.AccessController#doPrivileged(PrivilegedExceptionAction) method or null if this method is not available on the current VM.

protected final MethodDescription.InDefinedShape
methodDescription

A description of the method to be loaded onto the stack.

Constructor Summary

AccessConstructor and Description
protected
MethodConstant(MethodDescription.InDefinedShape
The method description for which the java.lang.reflect.Method representation should be created.
methodDescription
)

Creates a new method constant.

Method Summary

Modifier and TypeMethod and Description
protected abstract MethodDescription.InDefinedShape

Returns:

The method for loading a declared method or constructor onto the operand stack.
accessorMethod
()

Returns the method for loading a declared method or constructor onto the operand stack.

public StackManipulation.Size
apply(MethodVisitor
The method visitor used to write the method implementation to.
methodVisitor
,
Implementation.Context
The context of the current implementation.
implementationContext
)

Implements net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.
private static MethodDescription.InDefinedShape

Returns:

The doPrivileged method or null.
doPrivileged
()

Resolves the java.security.AccessController#doPrivileged method if the security manager is supported on the current VM and if security manager support is not explicitly disabled.

public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
protected abstract StackManipulation

Returns:

A stack manipulation that loads the method name onto the operand stack if this is required.
methodName
()

Returns a stack manipulation that loads the method name onto the operand stack if this is required.

public static MethodConstant.CanCache

Returns:

A stack manipulation that assigns a method constant for the given method description.
of
(MethodDescription.InDefinedShape
The method to be loaded onto the stack.
methodDescription
)

Creates a stack manipulation that loads a method constant onto the operand stack.

public static MethodConstant.CanCache

Returns:

A stack manipulation that assigns a method constant for the given method description.
ofPrivileged
(MethodDescription.InDefinedShape
The method to be loaded onto the stack.
methodDescription
)

Creates a stack manipulation that loads a method constant onto the operand stack using an java.security.AccessController.

protected static List<StackManipulation>

Returns:

A corresponding list of type constant load operations.
typeConstantsFor
(List<TypeDescription>
A list of all type descriptions that should be represented as type constant load operations.
parameterTypes
)

Returns a list of type constant load operations for the given list of parameters.

protected MethodConstant.CanCache

Returns:

A method constant that uses an java.security.AccessController to look up this constant.
withPrivilegedLookup
()

Returns a method constant that uses an java.security.AccessController to look up this constant.

Inherited from net.bytebuddy.implementation.bytecode.StackManipulation.AbstractBase:
isValid