当前位置: 首页>>代码示例>>Java>>正文


Java StandardJavaFileManager.getLocationAsPaths方法代码示例

本文整理汇总了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();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:JavacProcessingEnvironment.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:SJFM_Locations.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:SJFM_Locations.java


注:本文中的javax.tools.StandardJavaFileManager.getLocationAsPaths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。