當前位置: 首頁>>代碼示例>>Java>>正文


Java DelegatingEntityResolver類代碼示例

本文整理匯總了Java中org.springframework.beans.factory.xml.DelegatingEntityResolver的典型用法代碼示例。如果您正苦於以下問題:Java DelegatingEntityResolver類的具體用法?Java DelegatingEntityResolver怎麽用?Java DelegatingEntityResolver使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DelegatingEntityResolver類屬於org.springframework.beans.factory.xml包,在下文中一共展示了DelegatingEntityResolver類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createEntityResolver

import org.springframework.beans.factory.xml.DelegatingEntityResolver; //導入依賴的package包/類
/**
 * Similar to {@link #createNamespaceHandlerResolver(BundleContext, String, ClassLoader)} , this method creates
 * a special OSGi entity resolver that considers the bundle class path first, falling back to the entity resolver
 * service provided by the Spring DM extender.
 * 
 * @param bundleContext the OSGi context of which the resolver should be aware of
 * @param filter OSGi service filter
 * @param bundleClassLoader classloader for creating the OSGi namespace resolver proxy
 * @return a OSGi aware entity resolver
 */
private EntityResolver createEntityResolver(BundleContext bundleContext, String filter,
		ClassLoader bundleClassLoader) {
	Assert.notNull(bundleContext, "bundleContext is required");
	// create local namespace resolver
	EntityResolver localEntityResolver = new DelegatingEntityResolver(bundleClassLoader);
	// hook in OSGi namespace resolver
	EntityResolver osgiServiceEntityResolver = lookupEntityResolver(bundleContext, filter, localEntityResolver);

	ChainedEntityResolver delegate = new ChainedEntityResolver();
	delegate.addEntityResolver(localEntityResolver, "LocalEntityResolver for bundle "
			+ OsgiStringUtils.nullSafeNameAndSymName(bundleContext.getBundle()));

	// hook in OSGi namespace resolver
	delegate.addEntityResolver(osgiServiceEntityResolver, "OSGi Service resolver");

	return delegate;
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:28,代碼來源:OsgiBundleXmlApplicationContext.java

示例2: createEntityResolver

import org.springframework.beans.factory.xml.DelegatingEntityResolver; //導入依賴的package包/類
/**
 * Similar to {@link #createNamespaceHandlerResolver(BundleContext, ClassLoader, ClassLoader)}, this method creates
 * a special OSGi entity resolver that considers the bundle class path first, falling back to the entity resolver
 * service provided by the Spring DM extender.
 * 
 * @param bundleContext the OSGi context of which the resolver should be aware of
 * @param filter
 * @param bundleClassLoader classloader for creating the OSGi namespace resolver proxy
 * @return a OSGi aware entity resolver
 */
private EntityResolver createEntityResolver(BundleContext bundleContext, String filter,
		ClassLoader bundleClassLoader) {
	Assert.notNull(bundleContext, "bundleContext is required");
	// create local namespace resolver
	EntityResolver localEntityResolver = new DelegatingEntityResolver(bundleClassLoader);

	// hook in OSGi namespace resolver
	EntityResolver osgiServiceEntityResolver = lookupEntityResolver(bundleContext, filter, localEntityResolver);

	DelegatedEntityResolver delegate = new DelegatedEntityResolver();
	delegate.addEntityResolver(localEntityResolver, "LocalEntityResolver for bundle "
			+ OsgiStringUtils.nullSafeNameAndSymName(bundleContext.getBundle()));

	// hook in OSGi namespace resolver
	delegate.addEntityResolver(osgiServiceEntityResolver, "OSGi Service resolver");

	return delegate;
}
 
開發者ID:BeamFoundry,項目名稱:spring-osgi,代碼行數:29,代碼來源:OsgiBundleXmlApplicationContext.java

示例3: Plugin

import org.springframework.beans.factory.xml.DelegatingEntityResolver; //導入依賴的package包/類
private Plugin(Bundle bundle) {
	this.bundle = bundle;

	ClassLoader loader = BundleDelegatingClassLoader.createBundleClassLoaderFor(bundle);

	entity = new DelegatingEntityResolver(loader);
	namespace = new DefaultNamespaceHandlerResolver(loader);
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:9,代碼來源:NamespacePlugins.java

示例4: validate

import org.springframework.beans.factory.xml.DelegatingEntityResolver; //導入依賴的package包/類
@Override
public void validate(final InputStream xmlStream)
		throws ValidationFailedException {

	try {
		if (xsdSchema == null) {

			// get the source
			final InputSource inputSource = new InputSource(xmlStream);
			final EntityResolver resolver = new DelegatingEntityResolver(getClass()
					.getClassLoader());

			// use the DocumentLoader for validation, the DocumentLoader uses the
			// defined XSD of the document, it tries to use the one distributed via
			// the jar, otherwise it looks up the URL
			documentLoader.loadDocument(inputSource, resolver, errorHandler,
					XmlValidationModeDetector.VALIDATION_XSD, true);
		} else {

			// get the sources
			final Source xmlSource = new StreamSource(xmlStream);
			final Validator validator = xsdSchema.newValidator();

			// validate the document using the default Validator
			validator.validate(xmlSource);
		}
	} catch (final Exception e) {
		throw new ValidationFailedException("The loaded or the validation failed.", e);
	}
}
 
開發者ID:pmeisen,項目名稱:gen-sbconfigurator,代碼行數:31,代碼來源:DefaultXsdValidator.java


注:本文中的org.springframework.beans.factory.xml.DelegatingEntityResolver類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。