MethodType. A MethodTypeDescImpl corresponds to a
Constant_MethodType_info entry in the constant pool of a classfile.
| Modifier and Type | Field and Description |
|---|---|
| private final ClassDesc[] | |
| private String | |
| private final ClassDesc |
| Access | Constructor and Description |
|---|---|
| private | MethodTypeDescImpl(ClassDesc
a returnType, ClassDesc[] ClassDesc describing the return typeClassDescs describing the trusted and validated parameter typesConstructs a MethodTypeDesc with the specified return type and a trusted and already-validated parameter types array. |
| Modifier and Type | Method and Description |
|---|---|
| private String | |
| private static ClassDesc[] | |
| public MethodTypeDesc | changeParameterType(int index, ClassDesc paramType)
Implements java. Returns a MethodTypeDesc that is identical to this one, except that a single parameter type has been changed to the specified type. |
| public MethodTypeDesc | changeReturnType(ClassDesc returnType)
Implements java. Returns a MethodTypeDesc that is identical to this one, except with the specified return type. |
| public String | descriptorString()
Implements java. Returns the method type descriptor string. |
| public MethodTypeDesc | dropParameterTypes(int start, int end)
Implements java. Returns a MethodTypeDesc that is identical to this one, except that a range of parameter types have been removed. |
| public boolean | Returns: true if the specified MethodTypeDescImpl
is equal to this MethodTypeDescImpl.the o)MethodTypeDescImpl to compare to this
MethodTypeDescImplOverrides java. Implements java. Returns |
| public int | |
| public MethodTypeDesc | insertParameterTypes(int pos, ClassDesc... paramTypes)
Implements java. Returns a MethodTypeDesc that is identical to this one, except that a range of additional parameter types have been inserted. |
| public static MethodTypeDescImpl | Returns: a MethodTypeDescImpl describing the desired method typethe method descriptor string descriptor)Hides java. Creates a MethodTypeDescImpl given a method descriptor string. |
| public static MethodTypeDescImpl | |
| public static MethodTypeDescImpl | ofValidated(ClassDesc
a returnType, ClassDesc... ClassDesc describing the return typeClassDescs describing the trusted parameter typesConstructs a MethodTypeDesc with the specified pre-validated return type and a pre-validated trusted parameter types array. |
| public ClassDesc[] | parameterArray()
Implements java. Returns the parameter types as an array. |
| public int | parameterCount()
Implements java. Returns the number of parameters of the method type described by this MethodTypeDesc. |
| public List | parameterList()
Implements java. Returns the parameter types as an immutable |
| public ClassDesc | parameterType(int index)
Implements java. Returns the parameter type of the |
| private static ClassDesc[] | |
| public MethodType | resolveConstantDesc(MethodHandles.
Implements java. Resolves this descriptor reflectively, emulating the resolution behavior of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4. |
| public ClassDesc | returnType()
Implements java. Gets the return type of the method type described by this MethodTypeDesc. |
| public String | |
| private static ClassDesc |
| argTypes | back to summary |
|---|---|
| private final ClassDesc[] argTypes
| |
| cachedDescriptorString | back to summary |
|---|---|
| private String cachedDescriptorString
| |
| returnType | back to summary |
|---|---|
| private final ClassDesc returnType | |
| MethodTypeDescImpl | back to summary |
|---|---|
| private MethodTypeDescImpl(ClassDesc returnType, ClassDesc[] validatedArgTypes) Constructs a MethodTypeDesc with the specified return type and a trusted and already-validated parameter types array. | |
| buildDescriptorString | back to summary |
|---|---|
| private String buildDescriptorString() | |
| buildParamTypes | back to summary |
|---|---|
| private static ClassDesc[] buildParamTypes(String descriptor, int cur, int end, List<ClassDesc> list) | |
| changeParameterType | back to summary |
|---|---|
| public MethodTypeDesc changeParameterType(int index, ClassDesc paramType) Implements java. Doc from java. Returns a MethodTypeDesc that is identical to this one, except that a single parameter type has been changed to the specified type.
| |
| changeReturnType | back to summary |
|---|---|
| public MethodTypeDesc changeReturnType(ClassDesc returnType) Implements java. Doc from java. Returns a MethodTypeDesc that is identical to this one, except with the specified return type.
| |
| descriptorString | back to summary |
|---|---|
| public String descriptorString() Implements java. Doc from java. Returns the method type descriptor string.
| |
| dropParameterTypes | back to summary |
|---|---|
| public MethodTypeDesc dropParameterTypes(int start, int end) Implements java. Doc from java. Returns a MethodTypeDesc that is identical to this one, except that a range of parameter types have been removed.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Implements java. Returns | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| insertParameterTypes | back to summary |
|---|---|
| public MethodTypeDesc insertParameterTypes(int pos, ClassDesc... paramTypes) Implements java. Doc from java. Returns a MethodTypeDesc that is identical to this one, except that a range of additional parameter types have been inserted.
| |
| ofDescriptor | back to summary |
|---|---|
| public static MethodTypeDescImpl ofDescriptor(String descriptor) Hides java. Creates a MethodTypeDescImpl given a method descriptor string.
| |
| ofTrusted | back to summary |
|---|---|
| public static MethodTypeDescImpl ofTrusted(ClassDesc returnType, ClassDesc[] trustedArgTypes) Constructs a MethodTypeDesc with the specified return type and a trusted parameter types array, which will be validated. | |
| ofValidated | back to summary |
|---|---|
| public static MethodTypeDescImpl ofValidated(ClassDesc returnType, ClassDesc... trustedArgTypes) Constructs a MethodTypeDesc with the specified pre-validated return type and a pre-validated trusted parameter types array. | |
| parameterArray | back to summary |
|---|---|
| public ClassDesc[] parameterArray() Implements java. Doc from java. Returns the parameter types as an array.
| |
| parameterCount | back to summary |
|---|---|
| public int parameterCount() Implements java. Doc from java. Returns the number of parameters of the method type described by this MethodTypeDesc.
| |
| parameterList | back to summary |
|---|---|
| public List Implements java. Doc from java. Returns the parameter types as an immutable
| |
| parameterType | back to summary |
|---|---|
| public ClassDesc parameterType(int index) Implements java. Doc from java. Returns the parameter type of the
| |
| paramTypes | back to summary |
|---|---|
| private static ClassDesc[] paramTypes(String descriptor, int start, int end) | |
| resolveConstantDesc | back to summary |
|---|---|
| public MethodType resolveConstantDesc(MethodHandles. Implements java. Doc from java. Resolves this descriptor reflectively, emulating the resolution behavior
of JVMS 5.4.3 and the access control behavior of JVMS 5.4.4. The resolution
and access control context is provided by the
| |
| returnType | back to summary |
|---|---|
| public ClassDesc returnType() Implements java. Doc from java. Gets the return type of the method type described by this MethodTypeDesc.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| validateArgument | back to summary |
|---|---|
| private static ClassDesc validateArgument(ClassDesc arg) | |