MethodHandleDesc — 메서드 핸들 기술자
MethodHandleDesc — 메서드 핸들 기술자
MethodHandleDesc는 MethodHandle 상수에 대한 명목 기술자입니다.
본문
public sealed interface MethodHandleDesc extends ConstantDesc
permits DirectMethodHandleDesc (not exhaustive)
팩토리 메서드
static DirectMethodHandleDesc of(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String name, String lookupDescriptor)
static DirectMethodHandleDesc ofMethod(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String name, MethodTypeDesc lookupMethodType)
static DirectMethodHandleDesc ofField(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String fieldName, ClassDesc fieldType)
static DirectMethodHandleDesc ofConstructor(ClassDesc owner, ClassDesc... paramTypes)
of계열 메서드는 메서드, 필드, 생성자를 참조하는 직접 메서드 핸들 기술자를 생성합니다.kind는REF_invokeStatic같은 리플렉션 참조 종류를 나타냅니다.
주요 메서드
default MethodHandleDesc asType(MethodTypeDesc type)
MethodTypeDesc invocationType()
MethodHandle resolveConstantDesc(MethodHandles.Lookup lookup) throws ReflectiveOperationException
boolean equals(Object o)
invocationType()은 이 메서드 핸들의 호출 타입을 반환합니다.asType은 호출 타입을 조정한 기술자를 만들며, 메서드 핸들의asType에 해당합니다.resolveConstantDesc는 이 기술자를 실제MethodHandle로 해석합니다.