本文整理汇总了Java中com.sun.tools.javac.util.Options.get方法的典型用法代码示例。如果您正苦于以下问题:Java Options.get方法的具体用法?Java Options.get怎么用?Java Options.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.util.Options
的用法示例。
在下文中一共展示了Options.get方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Analyzer
import com.sun.tools.javac.util.Options; //导入方法依赖的package包/类
protected Analyzer(Context context) {
context.put(analyzerKey, this);
types = Types.instance(context);
log = Log.instance(context);
attr = Attr.instance(context);
deferredAttr = DeferredAttr.instance(context);
argumentAttr = ArgumentAttr.instance(context);
make = TreeMaker.instance(context);
names = Names.instance(context);
Options options = Options.instance(context);
String findOpt = options.get("find");
//parse modes
Source source = Source.instance(context);
allowDiamondWithAnonymousClassCreation = source.allowDiamondWithAnonymousClassCreation();
analyzerModes = AnalyzerMode.getAnalyzerModes(findOpt, source);
}
示例2: update
import com.sun.tools.javac.util.Options; //导入方法依赖的package包/类
void update(Options optionTable) {
for (Option o: options) {
String v = optionTable.get(o);
if (v != null) {
handleOption(o, v);
}
}
}
示例3: Modules
import com.sun.tools.javac.util.Options; //导入方法依赖的package包/类
protected Modules(Context context) {
context.put(Modules.class, this);
log = Log.instance(context);
names = Names.instance(context);
syms = Symtab.instance(context);
attr = Attr.instance(context);
chk = Check.instance(context);
deferredLintHandler = DeferredLintHandler.instance(context);
typeEnvs = TypeEnvs.instance(context);
moduleFinder = ModuleFinder.instance(context);
types = Types.instance(context);
fileManager = context.get(JavaFileManager.class);
source = Source.instance(context);
allowModules = source.allowModules();
Options options = Options.instance(context);
allowAccessIntoSystem = options.isUnset(Option.RELEASE);
lintOptions = options.isUnset(Option.XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option);
multiModuleMode = fileManager.hasLocation(StandardLocation.MODULE_SOURCE_PATH);
ClassWriter classWriter = ClassWriter.instance(context);
classWriter.multiModuleMode = multiModuleMode;
JNIWriter jniWriter = JNIWriter.instance(context);
jniWriter.multiModuleMode = multiModuleMode;
java_se = names.fromString("java.se");
java_ = names.fromString("java.");
addExportsOpt = options.get(Option.ADD_EXPORTS);
addReadsOpt = options.get(Option.ADD_READS);
addModsOpt = options.get(Option.ADD_MODULES);
limitModsOpt = options.get(Option.LIMIT_MODULES);
moduleVersionOpt = options.get(Option.MODULE_VERSION);
}
示例4: initContext
import com.sun.tools.javac.util.Options; //导入方法依赖的package包/类
private void initContext() {
//initialize compiler's default locale
context.put(Locale.class, locale);
if (!addModules.isEmpty()) {
String names = String.join(",", addModules);
Options opts = Options.instance(context);
String prev = opts.get(Option.ADD_MODULES);
opts.put(Option.ADD_MODULES, (prev == null) ? names : prev + "," + names);
}
}
示例5: Modules
import com.sun.tools.javac.util.Options; //导入方法依赖的package包/类
protected Modules(Context context) {
context.put(Modules.class, this);
log = Log.instance(context);
names = Names.instance(context);
syms = Symtab.instance(context);
attr = Attr.instance(context);
typeEnvs = TypeEnvs.instance(context);
moduleFinder = ModuleFinder.instance(context);
fileManager = context.get(JavaFileManager.class);
allowModules = Source.instance(context).allowModules();
Options options = Options.instance(context);
moduleOverride = options.get(Option.XMODULE);
multiModuleMode = fileManager.hasLocation(StandardLocation.MODULE_SOURCE_PATH);
ClassWriter classWriter = ClassWriter.instance(context);
classWriter.multiModuleMode = multiModuleMode;
JNIWriter jniWriter = JNIWriter.instance(context);
jniWriter.multiModuleMode = multiModuleMode;
java_se = names.fromString("java.se");
java_ = names.fromString("java.");
addExportsOpt = options.get(Option.XADDEXPORTS);
addReadsOpt = options.get(Option.XADDREADS);
addModsOpt = options.get(Option.ADDMODS);
limitModsOpt = options.get(Option.LIMITMODS);
}
示例6: Attr
import com.sun.tools.javac.util.Options; //导入方法依赖的package包/类
protected Attr(Context context) {
context.put(attrKey, this);
names = Names.instance(context);
log = Log.instance(context);
syms = Symtab.instance(context);
rs = Resolve.instance(context);
chk = Check.instance(context);
memberEnter = MemberEnter.instance(context);
make = TreeMaker.instance(context);
enter = Enter.instance(context);
infer = Infer.instance(context);
cfolder = ConstFold.instance(context);
target = Target.instance(context);
types = Types.instance(context);
diags = JCDiagnostic.Factory.instance(context);
annotate = Annotate.instance(context);
deferredLintHandler = DeferredLintHandler.instance(context);
Options options = Options.instance(context);
Source source = Source.instance(context);
allowGenerics = source.allowGenerics();
allowVarargs = source.allowVarargs();
allowEnums = source.allowEnums();
allowBoxing = source.allowBoxing();
allowCovariantReturns = source.allowCovariantReturns();
allowAnonOuterThis = source.allowAnonOuterThis();
allowStringsInSwitch = source.allowStringsInSwitch();
sourceName = source.name;
relax = (options.isSet("-retrofit") ||
options.isSet("-relax"));
findDiamonds = options.get("findDiamond") != null &&
source.allowDiamond();
useBeforeDeclarationWarning = options.isSet("useBeforeDeclarationWarning");
}
示例7: get
import com.sun.tools.javac.util.Options; //导入方法依赖的package包/类
public static PkgInfo get(Options options) {
String v = options.get(XPKGINFO);
return (v == null
? PkgInfo.LEGACY
: PkgInfo.valueOf(v.toUpperCase()));
}
示例8: setupPaths
import com.sun.tools.javac.util.Options; //导入方法依赖的package包/类
/**
* Sets class and output paths from command-line options.
*/
private void setupPaths() {
sourcePath = processingEnv.getOptions().get(OPT_SOURCEPATH);
classPath = processingEnv.getOptions().get(OPT_CLASSPATH);
outputDirectory = processingEnv.getOptions().get(OPT_CLASSOUTPUT);
/*
* Not using instanceof here because than in every case the JVM
* tries to load the JavacProcessingEnvironment-class file which,
* for instance, is not possible with an IBM JVM.
*
* TODO(lenh): This may not work; use reflection call instead.
*/
if (processingEnv.getClass().getName().equals(
"com.sun.tools.javac.processing.JavacProcessingEnvironment")) {
JavacProcessingEnvironment javacEnv =
(JavacProcessingEnvironment) processingEnv;
Options options = Options.instance(javacEnv.getContext());
if (sourcePath == null) {
sourcePath = options.get(OptionName.SOURCEPATH);
}
if (classPath == null) {
String classPath1 = options.get(OptionName.CP);
String classPath2 = options.get(OptionName.CLASSPATH);
if (classPath1 != null) {
if (classPath2 != null) {
classPath = classPath1 + File.pathSeparator + classPath2;
} else {
classPath = classPath1;
}
} else {
classPath = classPath2;
}
}
if (outputDirectory == null) {
outputDirectory = options.get(OptionName.D);
}
}
}
示例9: get
import com.sun.tools.javac.util.Options; //导入方法依赖的package包/类
public static PkgInfo get(Options options) {
String v = options.get(XPKGINFO);
return (v == null
? PkgInfo.LEGACY
: PkgInfo.valueOf(StringUtils.toUpperCase(v)));
}