Methods Summary |
---|
public java.lang.Object | getAdapter(IAdaptable adaptable, java.lang.Class adapterType)
List factoryList = factories.get(adapterType);
if (factoryList != null) {
for (Iterator factoryItr = factoryList.iterator(); factoryItr
.hasNext();) {
IAdapterFactory factory = (IAdapterFactory) factoryItr.next();
Object adapter = factory.getAdapter(adaptable, adapterType);
if (adapter != null) {
return adapter;
}
}
}
return null;
|
public boolean | hasAdapter(IAdaptable adaptable, java.lang.Class adapterType)
return null == getAdapter(adaptable, adapterType);
|
public void | registerAdapters(IAdapterFactory factory, java.lang.Class adaptable)
List<IAdapterFactory> factoryList = factories.get(adaptable);
if (factoryList == null) {
factoryList = new ArrayList<IAdapterFactory>();
factories.put(adaptable, factoryList);
}
factoryList.add(factory);
|
public void | unregisterAdapters(IAdapterFactory factory, java.lang.Class adaptable)
List factoryList = factories.get(adaptable);
if (factoryList != null) {
factoryList.remove(factory);
}
|
public void | unregisterAdapters(IAdapterFactory factory)
for (Iterator<Class> knownAdaptablesItr = factories.keySet().iterator(); knownAdaptablesItr
.hasNext();) {
Class adaptable = knownAdaptablesItr.next();
unregisterAdapters(factory, adaptable);
}
|