KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > zeus > Generator


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;
20
21 import java.io.File JavaDoc;
22 import java.io.IOException JavaDoc;
23
24 /**
25  * <p>
26  * <code>Generator</code> is the portion of Zeus that will convert
27  * a set of constraints, visible through a <code>{@link Binding}</code>,
28  * and output them as generated Java classes (to a
29  * <code>{@link Result}</code>.
30  * </p>
31  *
32  * @author Brett McLaughlin
33  * @author Maciej Zawadzki
34  */

35 public interface Generator {
36
37     /**
38      * <p>
39      * This sets the output directory to output generated classes to.
40      * </p>
41      *
42      * @param outputDir the name of the base directory where
43      * all generated classes should be placed
44      */

45     public void setOutputDirectory(String JavaDoc outputDir);
46     
47     /**
48      * <p>
49      * This sets the output directory to output generated classes to.
50      * </p>
51      *
52      * @param outputDir the <code>File</code> (directory) where
53      * all generated classes should be placed
54      */

55     public void setOutputDirectory(File JavaDoc outputDir);
56
57     /**
58      * <p>
59      * This allows a binding to be ignored. This is an intermediary step
60      * towards allowing binding schemas. The name of the binding should be
61      * passed in here, and no property generation for it will occur.
62      * </p>
63      *
64      * @param xmlName the XML local name associated with the binding.
65      * @param xmlNamespaceURI the XML namespace URI associated with the binding.
66      * The empty string indicates there is no namespace associated with
67      * the binding.
68      */

69     public void setIgnoreBinding(String JavaDoc xmlName, String JavaDoc xmlNamespaceURI);
70     
71     /**
72      * <p>
73      * This allows a binding to be ignored. This is an intermediary step
74      * towards allowing binding schemas. The name of the binding should be
75      * passed in here, and no property generation for it will occur.
76      * </p><p>
77      * This convenience version assumes that the XML name has no namespace
78      * URI associated with it, so supplies <tt>""</tt> for that value.
79      * </p>
80      *
81      * @param xmlName the XML local name associated with the binding.
82      */

83     public void setIgnoreBinding(String JavaDoc xmlName);
84
85     /**
86      * <p>
87      * This will convert from a set of constraints to Java classes.
88      * It accesses those constraints through the
89      * <code>{@link Binding}</code> interface, which provides
90      * them in a representation-independent format, and then
91      * converts them into Java code.
92      * </p>
93      *
94      * @param binder <code>Binder</code> with ability to convert from
95      * constraints to Zeus <code>Binding</code>s.
96      * @throws <code>IOException</code> - when errors in writing to the
97      * supplied <code>Result</code> occur.
98      * @throws <code>ZeusException</code> - when errors in class generation
99      * occur.
100      */

101     public void generate(Binding binding) throws IOException JavaDoc, ZeusException;
102 }
103
Popular Tags