public abstract class MethodConstant extends Object implements StackManipulation
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. | 
StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.Size, StackManipulation.Trivial| Modifier and Type | Field and Description | 
|---|---|
| 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 | 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. | 
| StackManipulation | cached()Returns a cached version of this method constant as specified by  MethodConstant.CachedMethodandMethodConstant.CachedConstructor. | 
| boolean | equals(Object other) | 
| static MethodConstant.CanCache | forMethod(MethodDescription.InDefinedShape methodDescription)Creates a stack manipulation that loads a method constant onto the operand stack. | 
| int | hashCode() | 
| boolean | isValid()Determines if this stack manipulation is valid. | 
| protected abstract StackManipulation | preparation()Returns a stack manipulation that loads the values that are required for loading a method constant onto the operand stack. | 
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 forMethod(MethodDescription.InDefinedShape methodDescription)
methodDescription - The method to be loaded onto the stack.public boolean isValid()
StackManipulationisValid in interface StackManipulationfalse, this manipulation cannot be applied and should throw an exception.public StackManipulation.Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext)
StackManipulationapply in interface StackManipulationmethodVisitor - The method visitor used to write the method implementation to.implementationContext - The context of the current implementation.protected abstract StackManipulation preparation()
protected abstract MethodDescription accessorMethod()
public StackManipulation cached()
MethodConstant.CachedMethod and MethodConstant.CachedConstructor.Copyright © 2014–2016. All rights reserved.