/** * Instantiates using {@code factory}. If {@code factory} is annotated nullable and returns null, * null will be returned. * * @throws ParameterNotInstantiableException if the static methods cannot be invoked because the * default value of a parameter cannot be determined. * @throws IllegalAccessException if the class isn't public or is nested inside a non-public * class, preventing its methods from being accessible. * @throws InvocationTargetException if a static method threw exception. */ private <T> @Nullable T instantiate(Invokable<?, ? extends T> factory) throws ParameterNotInstantiableException, InvocationTargetException, IllegalAccessException { return invoke(factory, getDummyArguments(factory)); }
/** * Instantiates using {@code factory}. If {@code factory} is annotated with {@link Nullable} and * returns null, null will be returned. * * @throws ParameterNotInstantiableException if the static methods cannot be invoked because * the default value of a parameter cannot be determined. * @throws IllegalAccessException if the class isn't public or is nested inside a non-public * class, preventing its methods from being accessible. * @throws InvocationTargetException if a static method threw exception. */ @Nullable private <T> T instantiate(Invokable<?, ? extends T> factory) throws ParameterNotInstantiableException, InvocationTargetException, IllegalAccessException { return invoke(factory, getDummyArguments(factory)); }
/** * Instantiates using {@code factory}. If {@code factory} is annotated nullable and returns null, * null will be returned. * * @throws ParameterNotInstantiableException if the static methods cannot be invoked because the * default value of a parameter cannot be determined. * @throws IllegalAccessException if the class isn't public or is nested inside a non-public * class, preventing its methods from being accessible. * @throws InvocationTargetException if a static method threw exception. */ private <T> @Nullable T instantiate(Invokable<?, ? extends T> factory) throws ParameterNotInstantiableException, InvocationTargetException, IllegalAccessException { return invoke(factory, getDummyArguments(factory)); }