KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > xml > xmlc > commands > xmlc > XMLCOptions


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  * Contributor(s):
20  *
21  * $Id: XMLCOptions.java,v 1.2 2005/01/26 08:29:24 jkjome Exp $
22  */

23
24 package org.enhydra.xml.xmlc.commands.xmlc;
25
26 import java.io.File JavaDoc;
27 import java.io.IOException JavaDoc;
28
29 import org.enhydra.xml.io.ErrorReporter;
30 import org.enhydra.xml.xmlc.XMLCException;
31 import org.enhydra.xml.xmlc.metadata.MetaData;
32  
33 /**
34  * Old XMLCOptions object. Here as a temporary measure for Kelp.
35  * @deprecated Here to support Kelp.
36  */

37 public class XMLCOptions extends XMLCOptionsParser {
38     /**
39      * Set the source file.
40      */

41     public void setSourceDocument(File JavaDoc sourceDocument) {
42         getMetaData().getInputDocument().setUrl(sourceDocument.getPath());
43     }
44
45     /**
46      * Get the fully qualified class name, or null if not specified.
47      */

48     public String JavaDoc getClassName() {
49         return getMetaData().getDocumentClass().getName();
50     }
51
52     /**
53      * Set the fully qualified class name.
54      */

55     public void setClassName(String JavaDoc className) {
56         getMetaData().getDocumentClass().setName(className);
57     }
58
59     /**
60      * Get the for-recomp flag.
61      */

62     public boolean getForRecomp() {
63         return getMetaData().getDocumentClass().getRecompilation();
64     }
65
66     /**
67      * Get the package name, or null if not set.
68      */

69     public String JavaDoc getPackageName() {
70         return getMetaData().getDocumentClass().getPackageName();
71     }
72
73     /**
74      * Default any options in the set that have not been specified.
75      * Determination of document type, and hence validation and defaulting of
76      * the parser base on document type, is handled outside of this class.
77      */

78     public void complete() throws XMLCException {
79         //FIXME: MetaDataDocument metaDataDoc = optParser.getMetaDataDoc();
80
//metaDataDoc.completeModifications();
81
}
82
83     /**
84      * Get metadata object.
85      */

86     public MetaData getMetaData() {
87         return null; //FIXME
88
}
89
90     /**
91      * Parse options and arguments.
92      */

93     public void parse(String JavaDoc[] parameters,
94                       String JavaDoc[] optionsFiles,
95                              ErrorReporter errorReporter) throws XMLCException, IOException JavaDoc {
96         // Combine into a argument vector
97
String JavaDoc[] args = new String JavaDoc[parameters.length + optionsFiles.length];
98         System.arraycopy(parameters, 0, args, 0, parameters.length);
99         System.arraycopy(optionsFiles, 0, args, parameters.length,
100                          optionsFiles.length);
101         super.parse(args, errorReporter);
102     }
103     //FIXME: tmp for supporting kelp rollover.
104
/** @deprecated for kelp only */
105     public void setKeep(boolean keep) {
106         getMetaData().getCompileOptions().setKeepGeneratedSource(keep);
107     }
108     /** @deprecated for kelp only */
109     public boolean getKeep() {
110         return getMetaData().getCompileOptions().getKeepGeneratedSource();
111     }
112     /** @deprecated for kelp only */
113     public void setDump(boolean dump) {
114         getMetaData().getCompileOptions().setPrintDOM(dump);
115     }
116     /** @deprecated for kelp only */
117     public boolean getDump() {
118         return getMetaData().getCompileOptions().getPrintDOM();
119     }
120     /** @deprecated for kelp only */
121     public void setVerbose(boolean verbose) {
122         getMetaData().getCompileOptions().setVerbose(verbose);
123     }
124     /** @deprecated for kelp only */
125     public boolean getVerbose() {
126         return getMetaData().getCompileOptions().getVerbose();
127     }
128     /** @deprecated for kelp only */
129     public void setParseInfo(boolean parseInfo) {
130         getMetaData().getCompileOptions().setPrintParseInfo(parseInfo);
131     }
132     /** @deprecated for kelp only */
133     public boolean getParseInfo() {
134         return getMetaData().getCompileOptions().getPrintParseInfo();
135     }
136     /** @deprecated for kelp only */
137     public void setPrintAccessMethods(boolean printAccessMethods) {
138         getMetaData().getCompileOptions().setPrintAccessorInfo(printAccessMethods);
139     }
140     /** @deprecated for kelp only */
141     public boolean getPrintAccessMethods() {
142         return getMetaData().getCompileOptions().getPrintAccessorInfo();
143     }
144     /** @deprecated for kelp only */
145     public void setNoCompile(boolean value) {
146         getMetaData().getCompileOptions().setCompileSource(value);
147     }
148     /** @deprecated for kelp only */
149     public boolean getNoCompile() {
150         return getMetaData().getCompileOptions().getCompileSource();
151     }
152     /** @deprecated for kelp only */
153     public File JavaDoc getDocumentOutput() {
154         return new File JavaDoc(getMetaData().getCompileOptions().getDocumentOutput());
155     }
156
157     /** @deprecated for kelp only */
158     public boolean getPrintVersion() {
159         return getMetaData().getCompileOptions().getPrintVersion();
160     }
161     /**
162      * Get the -info option value.
163      */

164     public boolean getPrintInfo() {
165         return getMetaData().getCompileOptions().getPrintParseInfo();
166     }
167
168 }
169
Popular Tags