当前位置: 首页>>代码示例>>Java>>正文


Java CatalogManager类代码示例

本文整理汇总了Java中org.apache.xml.resolver.CatalogManager的典型用法代码示例。如果您正苦于以下问题:Java CatalogManager类的具体用法?Java CatalogManager怎么用?Java CatalogManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CatalogManager类属于org.apache.xml.resolver包,在下文中一共展示了CatalogManager类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRouteBuilder

import org.apache.xml.resolver.CatalogManager; //导入依赖的package包/类
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    // we have to do it here, because we need the context created first
    CatalogManager.getStaticManager().setIgnoreMissingProperties(true);
    CatalogResolver catalogResolver = new CatalogResolver(true);
    URL catalogUrl = ResourceHelper.resolveMandatoryResourceAsUrl(context.getClassResolver(), "org/apache/camel/component/validator/catalog.cat");
    catalogResolver.getCatalog().parseCatalog(catalogUrl);
    LSResourceResolver resourceResolver = new CatalogLSResourceResolver(catalogResolver);
    JndiRegistry registry = (JndiRegistry) ((PropertyPlaceholderDelegateRegistry) context.getRegistry()).getRegistry();
    registry.bind("resourceResolver", resourceResolver);

    return new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:start")
                .doTry()
                    .to("validator:org/apache/camel/component/validator/report.xsd?resourceResolver=#resourceResolver")
                    .to("mock:valid")
                .doCatch(ValidationException.class)
                    .to("mock:invalid")
                .doFinally()
                    .to("mock:finally")
                .end();
        }
    };
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:27,代码来源:ValidatorWithResourceResolverRouteTest.java

示例2: CatalogResolver

import org.apache.xml.resolver.CatalogManager; //导入依赖的package包/类
public CatalogResolver( boolean throwIfNotFound, List<String> catalogs, boolean preferPublic )
{
    this.throwIfNotFound = throwIfNotFound;
    delegate.setCatalogList( catalogs.toArray( new String[ catalogs.size() ] ) );
    delegate.setPreferPublic( preferPublic );
    if( LOG.isDebugEnabled() )
    {
        try
        {
            Field catalogManagerField = XMLCatalogResolver.class.getDeclaredField( "fResolverCatalogManager" );
            catalogManagerField.setAccessible( true );
            CatalogManager catalogManager = (CatalogManager) catalogManagerField.get( delegate );
            catalogManager.setVerbosity( Integer.MAX_VALUE );
            catalogManager.debug = new Debug();
            catalogManagerField.setAccessible( false );
        }
        catch( NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException ex )
        {
            LOG.warn(
                "Unable to setup XML-Catalog resolution logging, something is broken, please report the issue!",
                ex
            );
        }
    }
}
 
开发者ID:werval,项目名称:werval,代码行数:26,代码来源:CatalogResolver.java

示例3: initResolver

import org.apache.xml.resolver.CatalogManager; //导入依赖的package包/类
private void initResolver() throws IOException {
	CatalogManager catalogManager = new CatalogManager();
	catalogManager.setUseStaticCatalog(true);
	catalogManager.setIgnoreMissingProperties(true);
	catalogManager.setVerbosity(1);
	catalogManager.setPreferPublic(true);
	CatalogResolver catalogResolver = new CatalogResolver(catalogManager);
	Catalog catalog = catalogResolver.getCatalog();

	if (catalogFiles != null && catalogFiles.length > 0) {
		for (File catalogFile : catalogFiles) {
			LOGGER.trace("Using catalog file {}", catalogFile);
			catalog.parseCatalog(catalogFile.getPath());
		}
	} else if (catalogResourceName != null) {
		LOGGER.trace("Using catalog from resource: {}", catalogResourceName);
		Enumeration<URL> catalogs = Thread.currentThread().getContextClassLoader().getResources(catalogResourceName);
		while (catalogs.hasMoreElements()) {
			URL catalogResourceUrl = catalogs.nextElement();
			LOGGER.trace("Parsing catalog from URL: {}", catalogResourceUrl);
			catalog.parseCatalog(catalogResourceUrl);
		}
	} else {
		throw new IllegalStateException("Catalog is not defined");
	}

	builtinSchemaResolver = catalogResolver;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:29,代码来源:SchemaRegistryImpl.java

示例4: testCatalogManager

import org.apache.xml.resolver.CatalogManager; //导入依赖的package包/类
public void testCatalogManager() throws Exception {
  XMLCatalogManager manager = getManager();
  CatalogManager catalogManager = manager.getManager();
  Vector files = catalogManager.getCatalogFiles();
  assertEquals(1, files.size());
  String filePath = (String)files.get(0);
  assertTrue(filePath, filePath.endsWith("catalog.xml"));
  assertTrue(filePath, new File(new URI(filePath)).exists());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:XMLCatalogManagerTest.java

示例5: init

import org.apache.xml.resolver.CatalogManager; //导入依赖的package包/类
/**
 * Initialization. Create a CatalogManager and set all 
 * the properties upfront. This prevents JVM wide system properties 
 * or a property file somewhere in the environment from affecting 
 * the behaviour of this catalog resolver.
 */
private void init (String [] catalogs, boolean preferPublic) {
    fCatalogsList = (catalogs != null) ? (String[]) catalogs.clone() : null;
    fPreferPublic = preferPublic;
    fResolverCatalogManager = new CatalogManager();
    fResolverCatalogManager.setAllowOasisXMLCatalogPI(false);
    fResolverCatalogManager.setCatalogClassName("org.apache.xml.resolver.Catalog");
    fResolverCatalogManager.setCatalogFiles("");
    fResolverCatalogManager.setIgnoreMissingProperties(true);
    fResolverCatalogManager.setPreferPublic(fPreferPublic);
    fResolverCatalogManager.setRelativeCatalogs(false);
    fResolverCatalogManager.setUseStaticCatalog(false);
    fResolverCatalogManager.setVerbosity(0);
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:20,代码来源:XMLCatalogResolver.java

示例6: getManager

import org.apache.xml.resolver.CatalogManager; //导入依赖的package包/类
@TestOnly
public CatalogManager getManager() {
  return myManager;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:XMLCatalogManager.java

示例7: OasisCatalog

import org.apache.xml.resolver.CatalogManager; //导入依赖的package包/类
OasisCatalog(CatalogManager catalogManager, SAXResolver saxResolver) {
  super(catalogManager);
  this.saxResolver = saxResolver;
  // don't call setupReaders; since we use our own parseCatalogFile
  // we'll load the catalogs lazily
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:7,代码来源:OasisCatalog.java

示例8: XmlValidatorCatalogResolver

import org.apache.xml.resolver.CatalogManager; //导入依赖的package包/类
public XmlValidatorCatalogResolver(CatalogManager manager) {
    super(manager);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:4,代码来源:XmlValidator.java

示例9: Catalog

import org.apache.xml.resolver.CatalogManager; //导入依赖的package包/类
/**
 * Constructs an empty Catalog with a specific CatalogManager.
 *
 * <p>The constructor interrogates the relevant system properties
 * using the specified Catalog Manager
 * and initializes the catalog data structures.</p>
 */
public Catalog(CatalogManager manager) {
  catalogManager = manager;
}
 
开发者ID:apache,项目名称:servicemix-bundles,代码行数:11,代码来源:Catalog.java

示例10: getCatalogManager

import org.apache.xml.resolver.CatalogManager; //导入依赖的package包/类
/**
 * Return the CatalogManager used by this catalog.
 *
 */
public CatalogManager getCatalogManager() {
  return catalogManager;
}
 
开发者ID:apache,项目名称:servicemix-bundles,代码行数:8,代码来源:Catalog.java

示例11: setCatalogManager

import org.apache.xml.resolver.CatalogManager; //导入依赖的package包/类
/**
 * Establish the CatalogManager used by this catalog.
 *
 */
public void setCatalogManager(CatalogManager manager) {
  catalogManager = manager;
}
 
开发者ID:apache,项目名称:servicemix-bundles,代码行数:8,代码来源:Catalog.java


注:本文中的org.apache.xml.resolver.CatalogManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。