View Javadoc

1   /*
2    * joey-gen and its relative products are published under the terms
3    * of the Apache Software License.
4    * 
5    * Created on 2005/01/13 16:19:47
6    */
7   package org.asyrinx.joey.gen.core;
8   
9   import java.io.File;
10  
11  import org.apache.velocity.context.Context;
12  
13  /***
14   * @author takeshi
15   */
16  public interface GenerationQuery {
17  
18      boolean canGenerate(String inputTemplate, File outputFile, Context context);
19  
20      final GenerationQuery THROUGH = new GenerationQuery() {
21          public boolean canGenerate(String inputTemplate, File outputFile, Context context) {
22              return true;
23          }
24      };
25  
26      final GenerationQuery DONT_OVERWRITE = new GenerationQuery() {
27          public boolean canGenerate(String inputTemplate, File outputFile, Context context) {
28              if (outputFile == null)
29                  return true;
30              return !outputFile.exists();
31          }
32      };
33  
34  }