List<ProviderInfo<RequestHandler>> shs = ProviderFactory.getInstance(m).getRequestHandlers();
// this is actually being tested by ProviderFactory unit tests but just in case
// WadlGenerator, the custom or default one, must be the first one
if (shs.size() > 0 && shs.get(0).getProvider() instanceof WadlGenerator) {
WadlGenerator wg = (WadlGenerator)shs.get(0).getProvider();
wg = new WadlGenerator(wg);
wg.setAddResourceAndMethodIds(true);
Response r = wg.handleRequest(m, resourceClass);
return r == null ? null : (String)r.getEntity();
}
return null;
}