本文整理汇总了Java中com.sun.tools.javac.util.Log.warning方法的典型用法代码示例。如果您正苦于以下问题:Java Log.warning方法的具体用法?Java Log.warning怎么用?Java Log.warning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.util.Log
的用法示例。
在下文中一共展示了Log.warning方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: importStringToPattern
import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
/**
* Convert import-style string for supported annotations into a
* regex matching that string. If the string is not a valid
* import-style string, return a regex that won't match anything.
*/
private static Pattern importStringToPattern(boolean allowModules, String s, Processor p, Log log) {
String module;
String pkg;
int slash = s.indexOf('/');
if (slash == (-1)) {
if (s.equals("*")) {
return MatchingUtils.validImportStringToPattern(s);
}
module = allowModules ? ".*/" : "";
pkg = s;
} else {
module = Pattern.quote(s.substring(0, slash + 1));
pkg = s.substring(slash + 1);
}
if (MatchingUtils.isValidImportString(pkg)) {
return Pattern.compile(module + MatchingUtils.validImportStringToPatternString(pkg));
} else {
log.warning(Warnings.ProcMalformedSupportedString(s, p.getClass().getName()));
return noMatches; // won't match any valid identifier
}
}
示例2: checkSourceVersionCompatibility
import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
/**
* Checks whether or not a processor's source version is
* compatible with the compilation source version. The
* processor's source version needs to be greater than or
* equal to the source version of the compile.
*/
private void checkSourceVersionCompatibility(Source source, Log log) {
SourceVersion procSourceVersion = processor.getSupportedSourceVersion();
if (procSourceVersion.compareTo(Source.toSourceVersion(source)) < 0 ) {
log.warning("proc.processor.incompatible.source.version",
procSourceVersion,
processor.getClass().getName(),
source.name);
}
}
示例3: importStringToPattern
import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
/**
* Convert import-style string for supported annotations into a
* regex matching that string. If the string is a valid
* import-style string, return a regex that won't match anything.
*/
private static Pattern importStringToPattern(String s, Processor p, Log log) {
if (isValidImportString(s)) {
return validImportStringToPattern(s);
} else {
log.warning("proc.malformed.supported.string", s, p.getClass().getName());
return noMatches; // won't match any valid identifier
}
}
示例4: checkSourceVersionCompatibility
import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
/**
* Checks whether or not a processor's source version is
* compatible with the compilation source version. The
* processor's source version needs to be greater than or
* equal to the source version of the compile.
*/
private void checkSourceVersionCompatibility(Source source, Log log) {
SourceVersion procSourceVersion = processor.getSupportedSourceVersion();
if (procSourceVersion.compareTo(Source.toSourceVersion(source)) < 0 ) {
log.warning(Warnings.ProcProcessorIncompatibleSourceVersion(procSourceVersion,
processor.getClass().getName(),
source.name));
}
}