public abstract class MethodConstant extends StackManipulation.AbstractBase
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.| Modifier and Type | Class and Description | 
|---|---|
| protected static class  | MethodConstant.CachedConstructorRepresents a cached constructor for a  MethodConstant. | 
| protected static class  | MethodConstant.CachedMethodRepresents a cached method for a  MethodConstant. | 
| static interface  | MethodConstant.CanCacheRepresents a  MethodConstantthat is
 directly loaded onto the operand stack without caching the value. | 
| protected static class  | MethodConstant.CanCacheIllegalRepresents a method constant that cannot be represented by Java's reflection API. | 
| protected static class  | MethodConstant.ForConstructorCreates a  MethodConstantfor loading
 aConstructorinstance onto the operand stack. | 
| protected static class  | MethodConstant.ForMethodCreates a  MethodConstantfor loading
 aMethodinstance onto the operand stack. | 
| protected static class  | MethodConstant.PrivilegedLookupPerforms a privileged lookup of a method constant by using an  java.security.AccessController. | 
StackManipulation.AbstractBase, StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.Simple, StackManipulation.Size, StackManipulation.Trivial| Modifier and Type | Field and Description | 
|---|---|
| protected static MethodDescription.InDefinedShape | DO_PRIVILEGEDThe  java.security.AccessController#doPrivileged(PrivilegedExceptionAction)method ornullif
 this method is not available on the current VM. | 
| protected MethodDescription.InDefinedShape | methodDescriptionA description of the method to be loaded onto the stack. | 
| Modifier | Constructor and Description | 
|---|---|
| protected  | MethodConstant(MethodDescription.InDefinedShape methodDescription)Creates a new method constant. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected abstract MethodDescription.InDefinedShape | accessorMethod()Returns the method for loading a declared method or constructor onto the operand stack. | 
| StackManipulation.Size | apply(MethodVisitor methodVisitor,
     Implementation.Context implementationContext)Applies the stack manipulation that is described by this instance. | 
| boolean | equals(Object other) | 
| int | hashCode() | 
| protected abstract StackManipulation | methodName()Returns a stack manipulation that loads the method name onto the operand stack if this is required. | 
| static MethodConstant.CanCache | of(MethodDescription.InDefinedShape methodDescription)Creates a stack manipulation that loads a method constant onto the operand stack. | 
| static MethodConstant.CanCache | ofPrivileged(MethodDescription.InDefinedShape methodDescription)Creates a stack manipulation that loads a method constant onto the operand stack using an  java.security.AccessController. | 
| protected static List<StackManipulation> | typeConstantsFor(List<TypeDescription> parameterTypes)Returns a list of type constant load operations for the given list of parameters. | 
| protected MethodConstant.CanCache | withPrivilegedLookup()Returns a method constant that uses an  java.security.AccessControllerto look up this constant. | 
isValid@MaybeNull protected static final MethodDescription.InDefinedShape DO_PRIVILEGED
java.security.AccessController#doPrivileged(PrivilegedExceptionAction) method or null if
 this method is not available on the current VM.protected final MethodDescription.InDefinedShape methodDescription
protected MethodConstant(MethodDescription.InDefinedShape methodDescription)
methodDescription - The method description for which the Method representation
                          should be created.public static MethodConstant.CanCache of(MethodDescription.InDefinedShape methodDescription)
methodDescription - The method to be loaded onto the stack.public static MethodConstant.CanCache ofPrivileged(MethodDescription.InDefinedShape methodDescription)
java.security.AccessController.
 If the current VM does not support the access controller API, or if net.bytebuddy.securitymanager is set to false, this
 method has the same effect as of(MethodDescription.InDefinedShape).methodDescription - The method to be loaded onto the stack.protected static List<StackManipulation> typeConstantsFor(List<TypeDescription> parameterTypes)
parameterTypes - A list of all type descriptions that should be represented as type constant
                       load operations.public StackManipulation.Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext)
methodVisitor - The method visitor used to write the method implementation to.implementationContext - The context of the current implementation.protected MethodConstant.CanCache withPrivilegedLookup()
java.security.AccessController to look up this constant.java.security.AccessController to look up this constant.protected abstract StackManipulation methodName()
protected abstract MethodDescription.InDefinedShape accessorMethod()
public boolean equals(@MaybeNull Object other)
Copyright © 2014–2023. All rights reserved.