156 * </li> |
156 * </li> |
157 * <li> |
157 * <li> |
158 * If {@code factoryId} is "javax.xml.stream.XMLEventFactory", |
158 * If {@code factoryId} is "javax.xml.stream.XMLEventFactory", |
159 * use the service-provider loading facilities, defined by the |
159 * use the service-provider loading facilities, defined by the |
160 * {@link java.util.ServiceLoader} class, to attempt to locate and load an |
160 * {@link java.util.ServiceLoader} class, to attempt to locate and load an |
161 * implementation of the service using the {@linkplain |
161 * implementation of the service using the specified {@code ClassLoader}. |
162 * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: |
162 * If {@code classLoader} is null, the {@linkplain |
163 * the service-provider loading facility will use the {@linkplain |
163 * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism} will apply: |
|
164 * That is, the service-provider loading facility will use the {@linkplain |
164 * java.lang.Thread#getContextClassLoader() current thread's context class loader} |
165 * java.lang.Thread#getContextClassLoader() current thread's context class loader} |
165 * to attempt to load the service. If the context class |
166 * to attempt to load the service. If the context class |
166 * loader is null, the {@linkplain |
167 * loader is null, the {@linkplain |
167 * ClassLoader#getSystemClassLoader() system class loader} will be used. |
168 * ClassLoader#getSystemClassLoader() system class loader} will be used. |
168 * </li> |
169 * </li> |
176 * {@link #newInstance(java.lang.String, java.lang.ClassLoader) |
177 * {@link #newInstance(java.lang.String, java.lang.ClassLoader) |
177 * newInstance(String factoryId, ClassLoader classLoader)} method. |
178 * newInstance(String factoryId, ClassLoader classLoader)} method. |
178 * No changes in behavior are defined by this replacement method relative |
179 * No changes in behavior are defined by this replacement method relative |
179 * to the deprecated method. |
180 * to the deprecated method. |
180 * </p> |
181 * </p> |
|
182 * |
|
183 * @apiNote The parameter factoryId defined here is inconsistent with that |
|
184 * of other JAXP factories where the first parameter is fully qualified |
|
185 * factory class name that provides implementation of the factory. |
181 * |
186 * |
182 * @param factoryId Name of the factory to find, same as |
187 * @param factoryId Name of the factory to find, same as |
183 * a property name |
188 * a property name |
184 * @param classLoader classLoader to use |
189 * @param classLoader classLoader to use |
185 * @return the factory implementation |
190 * @return the factory implementation |