[OmniFaces utilities] The
instance(String className)
creates an instance of a class with the given fully qualified class name.[OmniFaces utilities] The
instance(Class<T> clazz)
creates a new instance of the class represented by the given Class
object.Methods:
See also: Reflection#toClass()
Usage:
import
org.omnifaces.util.Reflection;
...
// example
1, fully qualified class name: book.beans.BookBean
BookBean bookBean =
Reflection.instance("book.beans.BookBean");
// or
BookBean bookBean =
Reflection.instance(book.beans.BookBean.class);
// example 2,
fully qualified class name: javax.faces.component.UIInput
UIInput uiInput =
Reflection.instance("javax.faces.component.UIInput");
// or
UIInput uiInput =
Reflection.instance(javax.faces.component.UIInput.class);
Niciun comentariu :
Trimiteți un comentariu