01: package org.objectweb.celtix.tools.generators.wsdl2;
02:
03: import org.objectweb.celtix.tools.common.ProcessorEnvironment;
04: import org.objectweb.celtix.tools.common.ToolConstants;
05: import org.objectweb.celtix.tools.common.ToolException;
06: import org.objectweb.celtix.tools.common.model.JavaModel;
07: import org.objectweb.celtix.tools.generators.AbstractGenerator;
08:
09: public class AntGenerator extends AbstractGenerator {
10:
11: private static final String ANT_TEMPLATE = TEMPLATE_BASE
12: + "/build.vm";
13:
14: public AntGenerator(JavaModel jmodel, ProcessorEnvironment env) {
15: super (jmodel, env);
16: this .name = ToolConstants.ANT_GENERATOR;
17: }
18:
19: public boolean passthrough() {
20: if (env.optionSet(ToolConstants.CFG_ANT)
21: || env.optionSet(ToolConstants.CFG_ALL)) {
22: return false;
23: }
24: return true;
25: }
26:
27: public void generate() throws ToolException {
28: if (passthrough()) {
29: return;
30: }
31: clearAttributes();
32: setAttributes("intfs", javaModel.getInterfaces().values());
33: setAttributes("wsdlLocation", javaModel.getLocation());
34: setCommonAttributes();
35:
36: doWrite(ANT_TEMPLATE, parseOutputName(null, "build", ".xml"));
37: }
38: }
|