本文整理汇总了Java中com.sun.org.apache.xml.internal.resolver.Catalog.parseCatalog方法的典型用法代码示例。如果您正苦于以下问题:Java Catalog.parseCatalog方法的具体用法?Java Catalog.parseCatalog怎么用?Java Catalog.parseCatalog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xml.internal.resolver.Catalog
的用法示例。
在下文中一共展示了Catalog.parseCatalog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEntityResolver
import com.sun.org.apache.xml.internal.resolver.Catalog; //导入方法依赖的package包/类
public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) {
// set up a manager
CatalogManager manager = new CatalogManager();
manager.setIgnoreMissingProperties(true);
// Using static catalog may result in to sharing of the catalog by multiple apps running in a container
manager.setUseStaticCatalog(false);
Catalog catalog = manager.getCatalog();
try {
if (catalogUrl != null) {
catalog.parseCatalog(catalogUrl);
}
} catch (IOException e) {
throw new ServerRtException("server.rt.err",e);
}
return workaroundCatalogResolver(catalog);
}
示例2: parseCatalogs
import com.sun.org.apache.xml.internal.resolver.Catalog; //导入方法依赖的package包/类
/**
* Instruct the <code>Catalog</code> to parse each of the
* catalogs in the list. Only the first catalog will actually be
* parsed immediately. The others will be queued and read if
* they are needed later.
*/
private void parseCatalogs () throws IOException {
if (fCatalogsList != null) {
fCatalog = new Catalog(fResolverCatalogManager);
attachReaderToCatalog(fCatalog);
for (int i = 0; i < fCatalogsList.length; ++i) {
String catalog = fCatalogsList[i];
if (catalog != null && catalog.length() > 0) {
fCatalog.parseCatalog(catalog);
}
}
}
else {
fCatalog = null;
}
}
示例3: createDefaultCatalogResolver
import com.sun.org.apache.xml.internal.resolver.Catalog; //导入方法依赖的package包/类
/**
* Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml
*/
public static EntityResolver createDefaultCatalogResolver() {
// set up a manager
CatalogManager manager = new CatalogManager();
manager.setIgnoreMissingProperties(true);
// Using static catalog may result in to sharing of the catalog by multiple apps running in a container
manager.setUseStaticCatalog(false);
// parse the catalog
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Enumeration<URL> catalogEnum;
Catalog catalog = manager.getCatalog();
try {
if (cl == null) {
catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml");
} else {
catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml");
}
while(catalogEnum.hasMoreElements()) {
URL url = catalogEnum.nextElement();
catalog.parseCatalog(url);
}
} catch (IOException e) {
throw new WebServiceException(e);
}
return workaroundCatalogResolver(catalog);
}