mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-26 16:22:06 +01:00
Added methods to get Iterators for IQ and PacketExtension providers.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2155 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
d4d351aae2
commit
f65b410766
1 changed files with 24 additions and 0 deletions
|
@ -274,6 +274,15 @@ public class ProviderManager {
|
||||||
return iqProviders.get(key);
|
return iqProviders.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an Iterator for all IQProvider instances.
|
||||||
|
*
|
||||||
|
* @return an Iterator for all IQProvider instances.
|
||||||
|
*/
|
||||||
|
public static Iterator getIQProviders() {
|
||||||
|
return Collections.unmodifiableCollection(new HashMap(iqProviders).values()).iterator();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an IQ provider (must be an instance of IQProvider or Class object that is an IQ)
|
* Adds an IQ provider (must be an instance of IQProvider or Class object that is an IQ)
|
||||||
* with the specified element name and name space. The provider will override any providers
|
* with the specified element name and name space. The provider will override any providers
|
||||||
|
@ -340,6 +349,16 @@ public class ProviderManager {
|
||||||
extensionProviders.put(key, provider);
|
extensionProviders.put(key, provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an Iterator for all PacketExtensionProvider instances.
|
||||||
|
*
|
||||||
|
* @return an Iterator for all PacketExtensionProvider instances.
|
||||||
|
*/
|
||||||
|
public static Iterator getExtensionProviders() {
|
||||||
|
return Collections.unmodifiableCollection(
|
||||||
|
new HashMap(extensionProviders).values()).iterator();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a String key for a given element name and namespace.
|
* Returns a String key for a given element name and namespace.
|
||||||
*
|
*
|
||||||
|
@ -353,6 +372,11 @@ public class ProviderManager {
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array of class loaders to load resources from.
|
||||||
|
*
|
||||||
|
* @return an array of ClassLoader instances.
|
||||||
|
*/
|
||||||
private static ClassLoader[] getClassLoaders() {
|
private static ClassLoader[] getClassLoaders() {
|
||||||
ClassLoader[] classLoaders = new ClassLoader[3];
|
ClassLoader[] classLoaders = new ClassLoader[3];
|
||||||
classLoaders[0] = new ProviderManager().getClass().getClassLoader();
|
classLoaders[0] = new ProviderManager().getClass().getClassLoader();
|
||||||
|
|
Loading…
Reference in a new issue