}
public void doExecute() throws Exception {
JavaSourceFactory jsf = new JavaSourceFactory();
JavaSourceFactory inputs = new JavaSourceFactory();
XmlRpcClientGenerator gen = new XmlRpcClientGenerator(jsf, getTargetPackage());
List sources = new ArrayList();
for (int i = 0; i < serverClasses.size(); i++) {
FileSet fs = (FileSet) serverClasses.get(i);
DirectoryScanner ds = fs.getDirectoryScanner(getProject());
String[] files = ds.getIncludedFiles();
for (int j = 0; j < files.length; j++) {
String s = files[j];
Reflector r;
if (s.endsWith(".class")) {
s = s.substring(0, s.length() - ".class".length());
r = new CompiledClassReflector(s.replace('/', '.'), Thread.currentThread().getContextClassLoader());
} else if (s.endsWith(".java")) {
r = new SourceReflector(new File(ds.getBasedir(), s));
} else {
throw new BuildException("Unknown extension in file name: " + s
+ ", expected .class or .java",
getLocation());
}
JavaSource js = r.getJavaSource(inputs);
sources.add(js);
}
}
for (int i = 0; i < sources.size(); i++) {
JavaSource js = (JavaSource) sources.get(i);
if (js.isAbstract()) {
getProject().log("Ignoring abstract class " + js.getQName(), Project.MSG_VERBOSE);
} else {
getProject().log("Generating XML-RPC client for " + js.getQName(), Project.MSG_DEBUG);
gen.addClass(js, inputs);
}
}
Dispatcher disp = getDispatcher();
if (disp != null) {
gen.setDispatcherImplementsXmlRpcHandler(disp.isImplementingXmlRpcHandler());
gen.getDispatcher(JavaQNameImpl.getInstance(disp.getName(), true));
}
jsf.write(getDestDir());
}