private MethodHandle findConstructor ( ) { try { MethodHandle mh = MethodHandles . publicLookup ( ) . findConstructor ( clazz , MethodType . methodType ( void . class , getIdType ( ) ) ) ; return mh ; } catch ( NoSuchMethodException | IllegalAccessException exp ) { String pattern = "Class %s requires a public constructor with one parameter of type %s" ; String error = String . format ( pattern , clazz . getName ( ) , getIdType ( ) ) ; throw new EntityManagerException ( error , exp ) ; } }
Creates and returns the MethodHandle for the constructor .