/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* TODO: describe com.sun.tools.javac.main.RecognizedOptions
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.</b></p>
*/
public class RecognizedOptions {
private RecognizedOptions() {}
public interface OptionHelper {
void printVersion();
void printFullVersion();
void printHelp();
void printXhelp();
}
throw new IllegalArgumentException();
}
}
public void printVersion() {
throw new IllegalArgumentException();
}
public void printFullVersion() {
throw new IllegalArgumentException();
}
public void printHelp() {
throw new IllegalArgumentException();
}
public void printXhelp() {
throw new IllegalArgumentException();
}
throw new IllegalArgumentException(f.getPath());
}
throw new IllegalArgumentException(s);
}
}
G,
CP,
PROC,
D,
S,
HELP,
A,
X,
J,
// COMPLEXINFERENCE,
DOE,
O,
XD,
AT,
CP,
D,
S,
SOURCE);
G,
PROC,
// VERSION,
// FULLVERSION,
// HELP,
A,
// X,
// J,
// COMPLEXINFERENCE,
DOE,
// XSTDOUT,
O,
XD);
}
}
}
}
/**
* Get all the recognized options.
* @param helper an {@code OptionHelper} to help when processing options
* @return an array of options
*/
return new Option[] {
new Option(G, "opt.g"),
return false;
}
},
// -nowarn is retained for command-line backward compatibility
return false;
}
},
// -deprecation is retained for command-line backward compatibility
return false;
}
},
}
},
}
},
}
},
}
},
}
},
return true;
}
}
},
return true;
}
}
},
}
},
new HiddenOption(FULLVERSION) {
}
},
new HiddenOption(DIAGS) {
"-XDdiagsFormat=" :
"-XDdiags=";
diagsOption += option;
else
return false;
}
},
}
},
String helpSynopsis() {
hasSuffix = true;
return super.helpSynopsis();
}
}
public boolean hasArg() {
return false;
}
// Mapping for processor options created in
// JavacProcessingEnvironment
if (argLength == 2) {
return true;
}
return true;
}
}
},
new Option(X, "opt.X") {
helper.printXhelp();
}
},
// This option exists only for the purpose of documenting itself.
// It's actually implemented by the launcher.
String helpSynopsis() {
hasSuffix = true;
return super.helpSynopsis();
}
throw new AssertionError
("the -J flag should be caught by the launcher.");
}
},
// stop after parsing and attributing.
// new HiddenOption("-attrparseonly"),
// new Option("-moreinfo", "opt.moreinfo") {
new HiddenOption(MOREINFO) {
}
},
// treat warnings as errors
// use complex inference from context in the position of a method call argument
new HiddenOption(COMPLEXINFERENCE),
// generare source stubs
// new HiddenOption("-stubs"),
// relax some constraints to allow compiling from stubs
// new HiddenOption("-relax"),
// output source after translating away inner classes
// new Option("-printflat", "opt.printflat"),
// new HiddenOption("-printflat"),
// display scope search details
// new Option("-printsearch", "opt.printsearch"),
// new HiddenOption("-printsearch"),
// prompt after each error
// new Option("-prompt", "opt.prompt"),
new HiddenOption(PROMPT),
// dump stack on error
new HiddenOption(DOE),
// output source after type erasure
// new Option("-s", "opt.s"),
new HiddenOption(PRINTSOURCE),
// output shrouded class files
// new Option("-scramble", "opt.scramble"),
// new Option("-scrambleall", "opt.scrambleall"),
// display warnings for generic unchecked operations
new HiddenOption(WARNUNCHECKED) {
return false;
}
},
try {
return true;
}
}
},
/* -O is a no-op, accepted for backward compatibility. */
new HiddenOption(O),
/* -Xjcov produces tables to support the code coverage tool jcov. */
new HiddenOption(XJCOV),
/* This is a back door to the compiler's option table.
* -XDx=y sets the option x to the value y.
* -XDx sets the option x to the value x.
*/
new HiddenOption(XD) {
String s;
this.s = s;
}
return false;
}
},
// This option exists only for the purpose of documenting itself.
// It's actually implemented by the CommandLine class.
String helpSynopsis() {
hasSuffix = true;
return super.helpSynopsis();
}
throw new AssertionError
("the @ flag should be caught by CommandLine.");
}
},
/*
* TODO: With apt, the matches method accepts anything if
* -XclassAsDecls is used; code elsewhere does the lookup to
* see if the class name is both legal and found.
*
* In apt, the process method adds the candidate class file
* name to a separate list.
*/
new HiddenOption(SOURCEFILE) {
String s;
this.s = s;
}
if (s.endsWith(".java") ) {
if (!f.exists()) {
return true;
}
if (!f.isFile()) {
return true;
}
}
else
helper.addClassName(s);
return false;
}
},
};
}
public enum PkgInfo {
return (v == null
}
}
return choices;
}
}