use of org.opendaylight.yangtools.yang.binding.annotations.ModuleQName in project controller by opendaylight.
the class ModuleQNameUtil method getQNames.
public static Set<String> getQNames(final Map<String, Entry<ModuleFactory, BundleContext>> resolved) {
final Set<String> result = new HashSet<>();
for (final Entry<ModuleFactory, BundleContext> entry : resolved.values()) {
Class<?> inspected = entry.getKey().getClass();
if (inspected.isInterface()) {
throw new IllegalArgumentException("Unexpected interface " + inspected);
}
ModuleQName annotation = null;
while (annotation == null && inspected != null) {
annotation = inspected.getAnnotation(ModuleQName.class);
inspected = inspected.getSuperclass();
}
if (annotation != null) {
result.add(QName.create(annotation.namespace(), annotation.revision(), annotation.name()).toString());
}
}
return result;
}
Aggregations