KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > zeus > util > SourceGenerator


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  */

19 package org.enhydra.zeus.util;
20
21 import java.io.File JavaDoc;
22 import java.io.InputStream JavaDoc;
23 import java.io.IOException JavaDoc;
24 import java.io.Reader JavaDoc;
25
26 // Zeus imports
27
import org.enhydra.zeus.ZeusException;
28
29 /**
30  * <p>
31  * This is a standalone "utility" interface. It allows source code
32  * generation from a set of XML constraints. It also allows for
33  * providing a standard set of methods that all utility source
34  * code generation classes should provide (at a minimum).
35  * </p>
36  *
37  * @author Brett McLaughlin
38  */

39 public interface SourceGenerator {
40
41     /**
42      * <p>
43      * This allows for supplying the constraints file to use
44      * for source code generation as a <code>String</code> URI.
45      * </p>
46      *
47      * @param fileURI <code>String</code> URI for constraints file.
48      * @throws <code>IOException</code> - when the specified file URI
49      * is invalid.
50      */

51     public void setConstraintsInput(String JavaDoc fileURI) throws IOException JavaDoc;
52
53     /**
54      * <p>
55      * This allows for supplying the constraints file to use
56      * for source code generation as a <code>File</code>.
57      * </p>
58      *
59      * @param file <code>File</code> to read constraints from.
60      * @throws <code>IOException</code> - when the specified file URI
61      * is invalid.
62      */

63     public void setConstraintsInput(File JavaDoc file) throws IOException JavaDoc;
64
65     /**
66      * <p>
67      * This allows for supplying the constraints file to use
68      * for source code generation as a <code>FileReader</code>.
69      * </p>
70      *
71      * @param reader <code>Reader</code> to read constraints
72      * from.
73      */

74     public void setConstraintsInput(Reader JavaDoc reader);
75
76     /**
77      * <p>
78      * This allows for supplying the constraints file to use
79      * for source code generation as an
80      * <code>InputStream</code>.
81      * </p>
82      *
83      * @param inputStream <code>InputStream</code> to read
84      * constraints from.
85      */

86     public void setConstraintsInput(InputStream JavaDoc inputStream);
87
88     /**
89      * <p>
90      * This allows specification of an output directory for the
91      * generated classes.
92      * </p>
93      *
94      * @param outputDir <code>String</code> specifying output directory
95      * for generated classes.
96      */

97     public void setOutputDir(String JavaDoc outputDir) throws IOException JavaDoc;
98
99     /**
100      * <p>
101      * This allows specification of an output directory for the
102      * generated classes.
103      * </p>
104      *
105      * @param outputDir <code>File</code> specifying output directory
106      * for generated classes.
107      */

108     public void setOutputDir(File JavaDoc outputDir) throws IOException JavaDoc;
109
110     /**
111      * <p>
112      * This will set the package for generating classes within.
113      * </p>
114      *
115      * @param javaPackage the package to generate classes within.
116      */

117     public void setJavaPackage(String JavaDoc javaPackage);
118     
119     /**
120      * <p>
121      * This sets whether or not to collapse simple elements. By default,
122      * simple elements are <i>not</i> collapsed. By default, ID attributes
123      * are <i>not</i> ignored in this determination.
124      * </p>
125      *
126      * @param collapseSimpleElements whether or not to collapse simple
127      * elements.
128      */

129     public void setCollapseSimpleElements(boolean collapseSimpleElements);
130     
131     /**
132      * <p>
133      * This sets whether or not to collapse simple elements. By default,
134      * simple elements are <i>not</i> collapsed. It also allows specification
135      * of whether ID attributes should be ignored when making a determination
136      * if an element is simple.
137      * </p>
138      *
139      * @param collapseSimpleElements whether or not to collapse simple
140      * elements.
141      * @param ignoreIDAttributes whether or not to ignore ID attributes.
142      */

143     public void setCollapseSimpleElements(boolean collapseSimpleElements,
144                                           boolean ignoreIDAttributes);
145
146     /**
147      * <p>
148      * This method performs class generation.
149      * </p>
150      *
151      * @throws <code>IOException</code> - when class generation fails
152      * @throws <code>ZeusException</code> - when class generation fails.
153      */

154     public void generate() throws IOException JavaDoc, ZeusException;
155 }
156
Popular Tags