01: /*
02: * Copyright (c) 2001, 2002 The XDoclet team
03: * All rights reserved.
04: */
05: package xdoclet.modules.knowlogy.validation;
06:
07: import xjavadoc.XClass;
08:
09: import xdoclet.TemplateSubTask;
10: import xdoclet.XDocletException;
11:
12: /**
13: * @author Robert
14: * @author Robert
15: * @created June 22, 2005
16: * @ant.element name="validate" display-name="Validation Subtask"
17: * parent="xdoclet.modules.knowlogy.validation.ValidationDocletTask"
18: */
19: public class GenerateValidationSubTask extends TemplateSubTask {
20:
21: public static final long serialVersionUID = 0;
22:
23: // the {0} will be replaced with the name of the class
24: private final static String OUTPUT = "{0}ClassValidator.java";
25:
26: private final static String TEMPLATE = "/xdoclet/modules/knowlogy/validation/resources/validators.xdt";
27:
28: /**
29: * Default constructor
30: */
31: public GenerateValidationSubTask() {
32: System.out.println("creating");
33: setTemplateURL(GenerateValidationSubTask.class
34: .getResource(TEMPLATE));
35: setAcceptInterfaces(false);
36: setHavingClassTag("validate.class");
37: setDestinationFile(OUTPUT);
38:
39: }
40:
41: public String getGeneratedFileName(XClass clazz)
42: throws XDocletException {
43: return super .getGeneratedFileName(clazz);
44: }
45:
46: public void execute() throws XDocletException {
47:
48: System.out.println("executing");
49: startProcess();
50: }
51:
52: //~ Methods ........................................................................................................
53:
54: /**
55: * Called when the engine is started
56: *
57: * @exception XDocletException Thrown in case of problem
58: */
59: protected void engineStarted() throws XDocletException {
60: System.out.println("engine started");
61: super .engineStarted();
62: }
63:
64: /**
65: * Since we want to support static inner classes, we set this to true.
66: *
67: * @return <code>true</code>
68: */
69: protected boolean processInnerClasses() {
70: return true;
71: }
72: }
|