public static class DynClasses.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
<S> Class<? extends S> |
build()
Returns the first implementation or throws RuntimeException if one was not found.
|
<S> Class<? extends S> |
buildChecked()
Returns the first implementation or throws ClassNotFoundException if one was not found.
|
DynClasses.Builder |
impl(String className)
Checks for an implementation of the class by name.
|
DynClasses.Builder |
loader(ClassLoader newLoader)
Set the
ClassLoader used to lookup classes by name. |
DynClasses.Builder |
orNull()
Instructs this builder to return null if no class is found, rather than throwing an
Exception.
|
public DynClasses.Builder loader(ClassLoader newLoader)
ClassLoader used to lookup classes by name.
If not set, the current thread's ClassLoader is used.
newLoader - a ClassLoaderpublic DynClasses.Builder impl(String className)
className - name of a classpublic DynClasses.Builder orNull()
public <S> Class<? extends S> buildChecked() throws ClassNotFoundException
S - Java superclassClass for the first implementation foundClassNotFoundException - if no implementation was foundpublic <S> Class<? extends S> build()
S - Java superclassClass for the first implementation foundRuntimeException - if no implementation was foundCopyright © 2023 The Apache Software Foundation. All rights reserved.