final List<WadlGeneratorDescription> list = wadlGeneratorDescriptions != null ? Arrays.asList(wadlGeneratorDescriptions) : null;
return loadWadlGeneratorDescriptions(list);
}
static WadlGenerator loadWadlGeneratorDescriptions(List<WadlGeneratorDescription> wadlGeneratorDescriptions) throws Exception {
WadlGenerator wadlGenerator = new WadlGeneratorImpl();
final CallbackList callbacks = new CallbackList();
try {
if (wadlGeneratorDescriptions != null && !wadlGeneratorDescriptions.isEmpty()) {
for (WadlGeneratorDescription wadlGeneratorDescription : wadlGeneratorDescriptions) {
final WadlGeneratorControl control = loadWadlGenerator(wadlGeneratorDescription, wadlGenerator);
wadlGenerator = control.wadlGenerator;
callbacks.add(control.callback);
}
}
wadlGenerator.init();
} finally {
callbacks.callback();
}
return wadlGenerator;