本文整理了Java中org.eclipse.core.internal.runtime.AdapterManager.addFactoriesFor()
方法的一些代码示例,展示了AdapterManager.addFactoriesFor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AdapterManager.addFactoriesFor()
方法的具体详情如下:
包路径:org.eclipse.core.internal.runtime.AdapterManager
类名称:AdapterManager
方法名:addFactoriesFor
[英]Given a type name, add all of the factories that respond to those types into the given table. Each entry will be keyed by the adapter class name (supplied in IAdapterFactory.getAdapterList).
[中]给定类型名称,将响应这些类型的所有工厂添加到给定表中。每个条目都将由适配器类名(在IAdapterFactory.getAdapterList中提供)键入。
代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.common
/**
* Computes the adapters that the provided class can adapt to, along
* with the factory object that can perform that transformation. Returns
* a table of adapter class name to factory object.
* @param adaptable
*/
private Map<String, IAdapterFactory> getFactories(Class<? extends Object> adaptable) {
//cache reference to lookup to protect against concurrent flush
Map<String, Map<String, IAdapterFactory>> lookup = adapterLookup;
if (lookup == null)
adapterLookup = lookup = Collections.synchronizedMap(new HashMap<String, Map<String, IAdapterFactory>>(30));
Map<String, IAdapterFactory> table = lookup.get(adaptable.getName());
if (table == null) {
// calculate adapters for the class
table = new HashMap<String, IAdapterFactory>(4);
Class<?>[] classes = computeClassOrder(adaptable);
for (int i = 0; i < classes.length; i++)
addFactoriesFor(classes[i].getName(), table);
// cache the table
lookup.put(adaptable.getName(), table);
}
return table;
}
代码示例来源:origin: org.eclipse.equinox/common
/**
* Computes the adapters that the provided class can adapt to, along
* with the factory object that can perform that transformation. Returns
* a table of adapter class name to factory object.
* @param adaptable
*/
private Map getFactories(Class adaptable) {
//cache reference to lookup to protect against concurrent flush
Map lookup = adapterLookup;
if (lookup == null)
adapterLookup = lookup = Collections.synchronizedMap(new HashMap(30));
Map table = (Map) lookup.get(adaptable.getName());
if (table == null) {
// calculate adapters for the class
table = new HashMap(4);
Class[] classes = computeClassOrder(adaptable);
for (int i = 0; i < classes.length; i++)
addFactoriesFor(classes[i].getName(), table);
// cache the table
lookup.put(adaptable.getName(), table);
}
return table;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.equinox.common
/**
* Computes the adapters that the provided class can adapt to, along
* with the factory object that can perform that transformation. Returns
* a table of adapter class name to factory object.
*/
private Map<String, IAdapterFactory> getFactories(Class<? extends Object> adaptable) {
//cache reference to lookup to protect against concurrent flush
Map<String, Map<String, IAdapterFactory>> lookup = adapterLookup;
if (lookup == null)
adapterLookup = lookup = Collections.synchronizedMap(new HashMap<String, Map<String, IAdapterFactory>>(30));
Map<String, IAdapterFactory> table = lookup.get(adaptable.getName());
if (table == null) {
// calculate adapters for the class
table = new HashMap<>(4);
Class<?>[] classes = computeClassOrder(adaptable);
for (int i = 0; i < classes.length; i++)
addFactoriesFor(classes[i].getName(), table);
// cache the table
lookup.put(adaptable.getName(), table);
}
return table;
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.equinox.common
/**
* Computes the adapters that the provided class can adapt to, along
* with the factory object that can perform that transformation. Returns
* a table of adapter class name to factory object.
* @param adaptable
*/
private Map getFactories(Class adaptable) {
//cache reference to lookup to protect against concurrent flush
Map lookup = adapterLookup;
if (lookup == null)
adapterLookup = lookup = Collections.synchronizedMap(new HashMap(30));
Map table = (Map) lookup.get(adaptable.getName());
if (table == null) {
// calculate adapters for the class
table = new HashMap(4);
Class[] classes = computeClassOrder(adaptable);
for (int i = 0; i < classes.length; i++)
addFactoriesFor(classes[i].getName(), table);
// cache the table
lookup.put(adaptable.getName(), table);
}
return table;
}
内容来源于网络,如有侵权,请联系作者删除!