use of org.apache.cxf.jaxrs.model.doc.DocumentationProvider in project cxf by apache.
the class Java2WADLMojo method execute.
public void execute() throws MojoExecutionException {
System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true");
List<Class<?>> resourceClasses = loadResourceClasses();
initClassResourceInfoList(resourceClasses);
WadlGenerator wadlGenerator = null;
if (customWadlGenerator != null) {
try {
wadlGenerator = (WadlGenerator) getClassLoader().loadClass(customWadlGenerator).getConstructor(new Class[] { Bus.class }).newInstance(new Object[] { getBus() });
} catch (Throwable e) {
getLog().debug("Custom WADLGenerator can not be created, using the default one");
}
}
if (wadlGenerator == null) {
wadlGenerator = new WadlGenerator(getBus());
}
DocumentationProvider documentationProvider = null;
if (docProvider != null) {
try {
documentationProvider = (DocumentationProvider) getClassLoader().loadClass(docProvider).getConstructor(new Class[] { String.class }).newInstance(new Object[] { project.getBuild().getDirectory() });
wadlGenerator.setDocumentationProvider(documentationProvider);
} catch (Exception e) {
throw new MojoExecutionException(e.getMessage(), e);
}
}
setExtraProperties(wadlGenerator);
StringBuilder sbMain = wadlGenerator.generateWADL(getBaseURI(), classResourceInfos, useJson, null, null);
getLog().debug("the wadl is =====> \n" + sbMain.toString());
generateWadl(resourceClasses, sbMain.toString());
}
Aggregations