MethodTypeDesc — 메서드 타입 기술자
MethodTypeDesc — 메서드 타입 기술자
MethodTypeDesc는 MethodType 상수에 대한 명목 기술자입니다.
본문
public sealed interface MethodTypeDesc extends ConstantDesc, TypeDescriptor.OfMethod<ClassDesc, MethodTypeDesc>
팩토리 메서드
static MethodTypeDesc ofDescriptor(String descriptor)
static MethodTypeDesc of(ClassDesc returnDesc)
static MethodTypeDesc of(ClassDesc returnDesc, List<ClassDesc> paramDescs)
static MethodTypeDesc of(ClassDesc returnDesc, ClassDesc... paramDescs)
ofDescriptor는 JVM 메서드 기술자 문자열(예:(ILjava/lang/String;)V)로부터 생성합니다.of계열은 반환 타입과 매개변수 타입의ClassDesc로부터 생성합니다.
주요 메서드
ClassDesc returnType()
int parameterCount()
ClassDesc parameterType(int index)
List<ClassDesc> parameterList()
ClassDesc[] parameterArray()
MethodTypeDesc changeReturnType(ClassDesc returnType)
MethodTypeDesc changeParameterType(int index, ClassDesc paramType)
MethodTypeDesc dropParameterTypes(int start, int end)
MethodTypeDesc insertParameterTypes(int pos, ClassDesc... paramTypes)
String descriptorString()
default String displayDescriptor()
MethodType resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException
boolean equals(Object o)
returnType()과parameterType(index)는 반환 타입과 특정 매개변수 타입을 반환합니다.change*,drop*,insert*계열 메서드는 타입을 조정한 새 기술자를 만듭니다.descriptorString()는 JVM 기술자 문자열을 반환합니다.resolveConstantDesc는 이 기술자를 실제MethodType으로 해석합니다.