KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > tools > generators > wsdl2 > AntGenerator


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