/** * {@inheritDoc} */ public void setClassLoader(final ClassLoader loader) { _internalContext.setClassLoader(loader); }
/** * Sets a custom {@link ClassLoader} to be used for loading classes. * * @param classLoader A custom {@link ClassLoader}. */ public void setClassLoader(ClassLoader classLoader) { this._internalContext.setClassLoader(classLoader); } }
/** * Creates a new {@link Unmarshaller} with the given Class. * * @param internalContext the {@link InternalContext} to be used, for config, and such... * @param c the {@link Class} to create the {@link Unmarshaller} for, this may be null, if the * Unmarshaller#setMapping is called to load a mapping for the root element of xml * document. * @param loader The {@link ClassLoader} to use. * * @throws IllegalArgumentException if internalContext is null */ public Unmarshaller(final InternalContext internalContext, final Class c, final ClassLoader loader) { super(); checkNotNull(internalContext, "InternalContext must not be null."); setInternalContext(internalContext); setClass(c); _loader = loader; if ((loader == null) && (c != null)) { _loader = c.getClassLoader(); } _internalContext.setClassLoader(_loader); }
_loader = c.getClassLoader(); _internalContext.setClassLoader(_loader);
ClassLoader loader = new URLClassLoader(urlList, _test.getClass().getClassLoader()); _test.setClassLoader(loader); getXMLContext().getInternalContext().setClassLoader(loader); } catch (Exception e) { if (!checkExceptionWasExpected(e, FailureStepType.LOAD_GENERATED_CLASSES)) {
ValidationContext v2 = new ValidationContext(); InternalContext ic = new BackwardCompatibilityContext(); ic.setClassLoader(object.getClass().getClassLoader()); v2.setInternalContext(ic); validate(object, v2);
ValidationContext v2 = new ValidationContext(); InternalContext ic = new BackwardCompatibilityContext(); ic.setClassLoader(object.getClass().getClassLoader()); v2.setInternalContext(ic); validate(object, v2);
loader = new URLClassLoader(new URL[] {_outputRootFile.toURL()}, loader); _test.setClassLoader(loader); getXMLContext().getInternalContext().setClassLoader(loader);