Skip to content

Method: WalkerTask(TaskExecutor)

1: package de.fhdw.wtf.walker.walker;
2:
3: import de.fhdw.wtf.common.ast.Attribute;
4: import de.fhdw.wtf.common.ast.ConstructorOrOperation;
5: import de.fhdw.wtf.common.ast.Group;
6: import de.fhdw.wtf.common.ast.type.ClassType;
7: import de.fhdw.wtf.common.exception.walker.TaskException;
8: import de.fhdw.wtf.common.task.DependencyTask;
9: import de.fhdw.wtf.common.task.TaskExecutor;
10:
11: /**
12: * Walker through the WTF model.
13: */
14: public abstract class WalkerTask extends DependencyTask {
15:         
16:         /**
17:          * Constructor for {@link WalkerTask}.
18:          *
19:          * @param taskmanager
20:          * Taskmanager
21:          */
22:         public WalkerTask(final TaskExecutor taskmanager) {
23:                 super(taskmanager);
24:         }
25:         
26:         /**
27:          * This handle will be called with each {@link ClassType} in a given model ONCE PER CLASSTYPE!
28:          *
29:          * @param c
30:          * ClassType to be handled
31:          * @throws TaskException
32:          * may be thrown by the implementing task
33:          */
34:         public abstract void handleClass(ClassType c) throws TaskException;
35:         
36:         /**
37:          * This handle will be called with each {@link Group} in a given model ONCE PER GROUP!
38:          *
39:          * @param g
40:          * Group to be handled
41:          * @throws TaskException
42:          * may be thrown by the implementing task
43:          */
44:         public abstract void handleGroup(Group g) throws TaskException;
45:         
46:         /**
47:          * This handle will be called with each {@link Attribute} in a given model ONCE PER ATTRIBUTE!
48:          *
49:          * @param a
50:          * Attribute to be handled
51:          * @param owner
52:          * Class with the attribute
53:          * @throws TaskException
54:          * may be thrown by the implementing task
55:          */
56:         public abstract void handleAttribute(Attribute a, ClassType owner) throws TaskException;
57:         
58:         /**
59:          * This handle will be called with each {@link ConstructorOrOperation} in a given model ONCE PER
60:          * CONSTRUCTOROROPERATION!
61:          *
62:          * @param coo
63:          * ConstructorOrOperation to be handled
64:          * @param owner
65:          * Class with the Constructor or Operation
66:          * @throws TaskException
67:          * may be thrown by the implementing task
68:          */
69:         public abstract void handleConstructorOrOperation(ConstructorOrOperation coo, ClassType owner) throws TaskException;
70:         
71:         /**
72:          * This operation will be called ONCE at the end of the task!
73:          *
74:          * @throws TaskException
75:          * may be thrown by the implementing task
76:          */
77:         public abstract void finalizeTask() throws TaskException;
78:         
79:         /**
80:          * This operation will be called ONCE at the begin of the task!
81:          *
82:          * @throws TaskException
83:          * may be thrown by the implementing task
84:          */
85:         public abstract void beginTask() throws TaskException;
86:         
87: }