01: /*
02: * Author: Chris Seguin
03: *
04: * This software has been developed under the copyleft
05: * rules of the GNU General Public License. Please
06: * consult the GNU General Public License for more
07: * details about use and distribution of this software.
08: */
09: package org.acm.seguin.refactor;
10:
11: import java.util.ArrayList;
12: import java.io.File;
13: import java.io.IOException;
14: import net.sourceforge.jrefactory.ast.SimpleNode;
15: import org.acm.seguin.pretty.PrettyPrintFile;
16: import org.acm.seguin.refactor.undo.UndoAction;
17: import org.acm.seguin.version.VersionControl;
18: import org.acm.seguin.version.VersionControlFactory;
19: import org.acm.seguin.awt.ExceptionPrinter;
20: import net.sourceforge.jrefactory.factory.FileParserFactory;
21: import net.sourceforge.jrefactory.factory.ParserFactory;
22:
23: /**
24: * Base class for a program that reads in an abstract syntax tree, transforms
25: * the code, and rewrites the file to disk.
26: *
27: *@author Chris Seguin
28: */
29: public interface ComplexTransform {
30:
31: public void setUndoAction(UndoAction init);
32:
33: /**
34: * Adds a syntax tree transformation
35: *
36: *@param value Description of Parameter
37: */
38: public void add(TransformAST value);
39:
40: /**
41: * Clears all the transforms
42: */
43: public void clear();
44:
45: /**
46: * Is it worth applying the transforms
47: *
48: *@return true if there is any
49: */
50: public boolean hasAnyChanges();
51:
52: /**
53: * Given a file, applies a set of transformations to it
54: *
55: *@param inputFile Description of Parameter
56: *@param outputFile Description of Parameter
57: */
58: public void apply(File inputFile, File outputFile);
59:
60: /**
61: * Creates a new file
62: *
63: *@param file Description of Parameter
64: */
65: public void createFile(File file);
66:
67: /**
68: * Removes an old file
69: *
70: *@param file Description of Parameter
71: */
72: public void removeFile(File file);
73: }
|