01: /*
02: * transformica 2
03: * Code generator
04: * Copyright (C) 2004 Hammurapi Group
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2 of the License, or (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: *
20: * URL: http://www.pavelvlasov.com/pv/content/menu.show@id=products.transformica.html
21: * e-Mail: support@hammurapi.biz
22: */
23: package biz.hammurapi.transformica;
24:
25: import java.io.File;
26:
27: import org.apache.tools.ant.BuildException;
28:
29: /**
30: * JDBC file info repository. Under construction
31: * @ant.element name="jdbctouchdetector"
32: * @author Pavel Vlasov
33: */
34: public class HypersonicTouchDetectorFactory implements
35: TouchDetectorFactory {
36:
37: public TouchDetector newTimeStampRepo() throws BuildException {
38: if (database == null) {
39: throw new BuildException("Timesamp file is not set");
40: }
41: try {
42: return new HypersonicTouchDetector(database, genRoot,
43: ignoreTimeStamp);
44: } catch (TransformicaException e) {
45: throw new BuildException(e);
46: }
47: }
48:
49: private File database;
50: private boolean ignoreTimeStamp = false;
51:
52: /**
53: * Database name
54: * @ant.required
55: * @param database
56: */
57: public void setDatabase(File database) {
58: this .database = database;
59: }
60:
61: private File genRoot;
62:
63: /**
64: * Generation root to calculate relative file names.
65: * If not set then absolute file names are used.
66: * @ant.non-required
67: * @param timeStampFile
68: */
69: public void setGenRoot(File genRoot) {
70: this .genRoot = genRoot;
71: }
72:
73: /**
74: * Ignore file time and use only size and checksum to detect whether file was modified.
75: * Default is false.
76: * @param ignoreTimeStamp
77: * @ant.non-required
78: */
79: public void setIgnoreTimeStamp(boolean ignoreTimeStamp) {
80: this.ignoreTimeStamp = ignoreTimeStamp;
81: }
82: }
|