/** * Checks for an implementation, first finding the given class by name. * * @param className name of a class * @param methodName name of a method (different from constructor) * @param argClasses argument classes for the method * @return this Builder for method chaining * @see {@link java.lang.Class#forName(String)} * @see {@link java.lang.Class#getMethod(String, Class[])} */ public Builder hiddenImpl(String className, String methodName, Class<?>... argClasses) { // don't do any work if an implementation has been found if (method != null) { return this; } try { Class<?> targetClass = Class.forName(className, true, loader); hiddenImpl(targetClass, methodName, argClasses); } catch (ClassNotFoundException e) { // not the right implementation } return this; }
/** * Checks for an implementation, first finding the given class by name. * * @param className name of a class * @param methodName name of a method (different from constructor) * @param argClasses argument classes for the method * @return this Builder for method chaining * @see {@link java.lang.Class#forName(String)} * @see {@link java.lang.Class#getMethod(String, Class[])} */ public Builder impl(String className, String methodName, Class<?>... argClasses) { // don't do any work if an implementation has been found if (method != null) { return this; } try { Class<?> targetClass = Class.forName(className, true, loader); impl(targetClass, methodName, argClasses); } catch (ClassNotFoundException e) { // not the right implementation } return this; }
/** * Checks for an implementation, first finding the given class by name. * * @param className name of a class * @param methodName name of a method (different from constructor) * @param argClasses argument classes for the method * @return this Builder for method chaining * @see {@link java.lang.Class#forName(String)} * @see {@link java.lang.Class#getMethod(String, Class[])} */ public Builder hiddenImpl(String className, String methodName, Class<?>... argClasses) { // don't do any work if an implementation has been found if (method != null) { return this; } try { Class<?> targetClass = Class.forName(className, true, loader); hiddenImpl(targetClass, methodName, argClasses); } catch (ClassNotFoundException e) { // not the right implementation } return this; }
/** * Checks for an implementation, first finding the given class by name. * * @param className name of a class * @param methodName name of a method (different from constructor) * @param argClasses argument classes for the method * @return this Builder for method chaining * @see {@link java.lang.Class#forName(String)} * @see {@link java.lang.Class#getMethod(String, Class[])} */ public Builder impl(String className, String methodName, Class<?>... argClasses) { // don't do any work if an implementation has been found if (method != null) { return this; } try { Class<?> targetClass = Class.forName(className, true, loader); impl(targetClass, methodName, argClasses); } catch (ClassNotFoundException e) { // not the right implementation } return this; }
/** * Checks for an implementation, first finding the given class by name. * * The name passed to the constructor is the method name used. * * @param className name of a class * @param argClasses argument classes for the method * @return this Builder for method chaining * @see {@link java.lang.Class#forName(String)} * @see {@link java.lang.Class#getMethod(String, Class[])} */ public Builder impl(String className, Class<?>... argClasses) { impl(className, name, argClasses); return this; }
/** * Checks for an implementation, first finding the given class by name. * * The name passed to the constructor is the method name used. * * @param className name of a class * @param argClasses argument classes for the method * @return this Builder for method chaining * @see {@link java.lang.Class#forName(String)} * @see {@link java.lang.Class#getMethod(String, Class[])} */ public Builder hiddenImpl(String className, Class<?>... argClasses) { hiddenImpl(className, name, argClasses); return this; }
/** * Checks for an implementation, first finding the given class by name. * * The name passed to the constructor is the method name used. * * @param className name of a class * @param argClasses argument classes for the method * @return this Builder for method chaining * @see {@link java.lang.Class#forName(String)} * @see {@link java.lang.Class#getMethod(String, Class[])} */ public Builder hiddenImpl(String className, Class<?>... argClasses) { hiddenImpl(className, name, argClasses); return this; }
/** * Checks for a method implementation. * * The name passed to the constructor is the method name used. * * @param argClasses argument classes for the method * @return this Builder for method chaining * @see {@link java.lang.Class#forName(String)} * @see {@link java.lang.Class#getMethod(String, Class[])} */ public Builder hiddenImpl(Class<?> targetClass, Class<?>... argClasses) { hiddenImpl(targetClass, name, argClasses); return this; }
/** * Checks for a method implementation. * * The name passed to the constructor is the method name used. * * @param argClasses argument classes for the method * @return this Builder for method chaining * @see {@link java.lang.Class#forName(String)} * @see {@link java.lang.Class#getMethod(String, Class[])} */ public Builder hiddenImpl(Class<?> targetClass, Class<?>... argClasses) { hiddenImpl(targetClass, name, argClasses); return this; }
/** * Checks for a method implementation. * * The name passed to the constructor is the method name used. * * @param argClasses argument classes for the method * @return this Builder for method chaining * @see {@link java.lang.Class#forName(String)} * @see {@link java.lang.Class#getMethod(String, Class[])} */ public Builder impl(Class<?> targetClass, Class<?>... argClasses) { impl(targetClass, name, argClasses); return this; }
/** * Returns the first valid implementation as a BoundMethod or throws a * NoSuchMethodException if there is none. * * @param receiver an Object to receive the method invocation * @return a {@link BoundMethod} with a valid implementation and receiver * @throws IllegalStateException if the method is static * @throws IllegalArgumentException if the receiver's class is incompatible * @throws NoSuchMethodException if no implementation was found */ public BoundMethod buildChecked(Object receiver) throws NoSuchMethodException { return buildChecked().bind(receiver); }
/** * Checks for an implementation, first finding the given class by name. * * The name passed to the constructor is the method name used. * * @param className name of a class * @param argClasses argument classes for the method * @return this Builder for method chaining * @see {@link java.lang.Class#forName(String)} * @see {@link java.lang.Class#getMethod(String, Class[])} */ public Builder impl(String className, Class<?>... argClasses) { impl(className, name, argClasses); return this; }
/** * Checks for a method implementation. * * The name passed to the constructor is the method name used. * * @param argClasses argument classes for the method * @return this Builder for method chaining * @see {@link java.lang.Class#forName(String)} * @see {@link java.lang.Class#getMethod(String, Class[])} */ public Builder impl(Class<?> targetClass, Class<?>... argClasses) { impl(targetClass, name, argClasses); return this; }
/** * Returns the first valid implementation as a BoundMethod or throws a * RuntimeError if there is none. * * @param receiver an Object to receive the method invocation * @return a {@link BoundMethod} with a valid implementation and receiver * @throws IllegalStateException if the method is static * @throws IllegalArgumentException if the receiver's class is incompatible * @throws RuntimeException if no implementation was found */ public BoundMethod build(Object receiver) { return build().bind(receiver); }
/** * Returns the first valid implementation as a BoundMethod or throws a * RuntimeError if there is none. * * @param receiver an Object to receive the method invocation * @return a {@link BoundMethod} with a valid implementation and receiver * @throws IllegalStateException if the method is static * @throws IllegalArgumentException if the receiver's class is incompatible * @throws RuntimeException if no implementation was found */ public BoundMethod build(Object receiver) { return build().bind(receiver); }
/** * Returns the first valid implementation as a BoundMethod or throws a * NoSuchMethodException if there is none. * * @param receiver an Object to receive the method invocation * @return a {@link BoundMethod} with a valid implementation and receiver * @throws IllegalStateException if the method is static * @throws IllegalArgumentException if the receiver's class is incompatible * @throws NoSuchMethodException if no implementation was found */ public BoundMethod buildChecked(Object receiver) throws NoSuchMethodException { return buildChecked().bind(receiver); }
/** * Returns the first valid implementation as a StaticMethod or throws a * RuntimeException if there is none. * * @return a {@link StaticMethod} with a valid implementation * @throws IllegalStateException if the method is not static * @throws RuntimeException if no implementation was found */ public StaticMethod buildStatic() { return build().asStatic(); }
/** * Returns the first valid implementation as a StaticMethod or throws a * NoSuchMethodException if there is none. * * @return a {@link StaticMethod} with a valid implementation * @throws IllegalStateException if the method is not static * @throws NoSuchMethodException if no implementation was found */ public StaticMethod buildStaticChecked() throws NoSuchMethodException { return buildChecked().asStatic(); }
/** * Returns the first valid implementation as a StaticMethod or throws a * NoSuchMethodException if there is none. * * @return a {@link StaticMethod} with a valid implementation * @throws IllegalStateException if the method is not static * @throws NoSuchMethodException if no implementation was found */ public StaticMethod buildStaticChecked() throws NoSuchMethodException { return buildChecked().asStatic(); }
/** * Returns the first valid implementation as a StaticMethod or throws a * RuntimeException if there is none. * * @return a {@link StaticMethod} with a valid implementation * @throws IllegalStateException if the method is not static * @throws RuntimeException if no implementation was found */ public StaticMethod buildStatic() { return build().asStatic(); }