本文整理汇总了Java中javax.tools.StandardJavaFileManager.getLocationAsPaths方法的典型用法代码示例。如果您正苦于以下问题:Java StandardJavaFileManager.getLocationAsPaths方法的具体用法?Java StandardJavaFileManager.getLocationAsPaths怎么用?Java StandardJavaFileManager.getLocationAsPaths使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.tools.StandardJavaFileManager
的用法示例。
在下文中一共展示了StandardJavaFileManager.getLocationAsPaths方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleServiceLoaderUnavailability
import javax.tools.StandardJavaFileManager; //导入方法依赖的package包/类
/**
* Returns an empty processor iterator if no processors are on the
* relevant path, otherwise if processors are present, logs an
* error. Called when a service loader is unavailable for some
* reason, either because a service loader class cannot be found
* or because a security policy prevents class loaders from being
* created.
*
* @param key The resource key to use to log an error message
* @param e If non-null, pass this exception to Abort
*/
private Iterator<Processor> handleServiceLoaderUnavailability(String key, Exception e) {
if (fileManager instanceof JavacFileManager) {
StandardJavaFileManager standardFileManager = (JavacFileManager) fileManager;
Iterable<? extends Path> workingPath = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH)
? standardFileManager.getLocationAsPaths(ANNOTATION_PROCESSOR_PATH)
: standardFileManager.getLocationAsPaths(CLASS_PATH);
if (needClassLoader(options.get(Option.PROCESSOR), workingPath) )
handleException(key, e);
} else {
handleException(key, e);
}
java.util.List<Processor> pl = Collections.emptyList();
return pl.iterator();
}
示例2: test_setFiles_getPaths
import javax.tools.StandardJavaFileManager; //导入方法依赖的package包/类
void test_setFiles_getPaths(StandardJavaFileManager fm, List<File> inFiles) throws IOException {
System.err.println("test_setFiles_getPaths");
JavaFileManager.Location l = newLocation();
fm.setLocation(l, inFiles);
Iterable<? extends Path> outPaths = fm.getLocationAsPaths(l);
compare(inFiles, outPaths);
}
示例3: test_setPaths_getPaths
import javax.tools.StandardJavaFileManager; //导入方法依赖的package包/类
void test_setPaths_getPaths(StandardJavaFileManager fm, List<Path> inPaths) throws IOException {
System.err.println("test_setPaths_getPaths");
JavaFileManager.Location l = newLocation();
fm.setLocationFromPaths(l, inPaths);
Iterable<? extends Path> outPaths = fm.getLocationAsPaths(l);
compare(inPaths, outPaths);
}