@@ -64,6 +64,22 @@ public Beans() {}
6464 * <p>
6565 * Instantiate a JavaBean.
6666 * </p>
67+ * The bean is created based on a name relative to a class-loader.
68+ * This name should be a {@linkplain ClassLoader##binary-name binary name} of a class such as "a.b.C".
69+ * <p>
70+ * The given name can indicate either a serialized object or a class.
71+ * We first try to treat the {@code beanName} as a serialized object
72+ * name then as a class name.
73+ * <p>
74+ * When using the {@code beanName} as a serialized object name we convert the
75+ * given {@code beanName} to a resource pathname and add a trailing ".ser" suffix.
76+ * We then try to load a serialized object from that resource.
77+ * <p>
78+ * For example, given a {@code beanName} of "x.y", {@code Beans.instantiate} would first
79+ * try to read a serialized object from the resource "x/y.ser" and if
80+ * that failed it would try to load the class "x.y" and create an
81+ * instance of that class.
82+ *
6783 * @return a JavaBean
6884 * @param cls the class-loader from which we should create
6985 * the bean. If this is null, then the system
@@ -84,6 +100,22 @@ public static Object instantiate(ClassLoader cls, String beanName) throws IOExce
84100 * <p>
85101 * Instantiate a JavaBean.
86102 * </p>
103+ * The bean is created based on a name relative to a class-loader.
104+ * This name should be a {@linkplain ClassLoader##binary-name binary name} of a class such as "a.b.C".
105+ * <p>
106+ * The given name can indicate either a serialized object or a class.
107+ * We first try to treat the {@code beanName} as a serialized object
108+ * name then as a class name.
109+ * <p>
110+ * When using the {@code beanName} as a serialized object name we convert the
111+ * given {@code beanName} to a resource pathname and add a trailing ".ser" suffix.
112+ * We then try to load a serialized object from that resource.
113+ * <p>
114+ * For example, given a {@code beanName} of "x.y", {@code Beans.instantiate} would first
115+ * try to read a serialized object from the resource "x/y.ser" and if
116+ * that failed it would try to load the class "x.y" and create an
117+ * instance of that class.
118+ *
87119 * @return a JavaBean
88120 *
89121 * @param cls the class-loader from which we should create
0 commit comments