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


Java StandardLocation.PLATFORM_CLASS_PATH属性代码示例

本文整理汇总了Java中javax.tools.StandardLocation.PLATFORM_CLASS_PATH属性的典型用法代码示例。如果您正苦于以下问题:Java StandardLocation.PLATFORM_CLASS_PATH属性的具体用法?Java StandardLocation.PLATFORM_CLASS_PATH怎么用?Java StandardLocation.PLATFORM_CLASS_PATH使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.tools.StandardLocation的用法示例。


在下文中一共展示了StandardLocation.PLATFORM_CLASS_PATH属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: list

@Override
public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException {
    if (location != StandardLocation.PLATFORM_CLASS_PATH || !kinds.contains(Kind.CLASS))
        return Collections.emptyList();

    if (!packageName.isEmpty())
        packageName += ".";

    List<JavaFileObject> result = new ArrayList<>();

    for (Entry<String, JavaFileObject> e : className2File.entrySet()) {
        String currentPackage = e.getKey().substring(0, e.getKey().lastIndexOf(".") + 1);
        if (recurse ? currentPackage.startsWith(packageName) : packageName.equals(currentPackage))
            result.add(e.getValue());
    }

    return result;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:ElementStructureTest.java

示例2: testBasic

@Test
public void testBasic(Path base) throws IOException {
    try (StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null)) {
        Location[] locns = {
            StandardLocation.SOURCE_PATH,
            StandardLocation.CLASS_PATH,
            StandardLocation.PLATFORM_CLASS_PATH,
        };
        // set a value
        Path out = Files.createDirectories(base.resolve("out"));
        for (Location locn : locns) {
            checkException("unsupported for location",
                    IllegalArgumentException.class,
                    "location is not an output location or a module-oriented location: " + locn,
                    () -> fm.setLocationForModule(locn, "m", List.of(out)));
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:SetLocationForModule.java

示例3: getLocation

@Override
public Iterable<? extends File> getLocation(Location location) {
    org.openide.filesystems.FileObject[] roots;
    ClassPath cp = null;
    if (location == StandardLocation.SOURCE_PATH) {
        cp = cpInfo.getClassPath(ClasspathInfo.PathKind.SOURCE);
    } else if (location == StandardLocation.CLASS_PATH) {
        cp = cpInfo.getClassPath(ClasspathInfo.PathKind.COMPILE);
    } else if (location == StandardLocation.PLATFORM_CLASS_PATH) {
        cp = cpInfo.getClassPath(ClasspathInfo.PathKind.BOOT);
    }
    if (cp == null) {
        return null;
    }
    roots = cp.getRoots();
    if (roots == null || roots.length == 0) {
        return null;
    }
    List<File> res = new ArrayList<>(roots.length);
    for (org.openide.filesystems.FileObject f : roots) {
        File x = FileUtil.toFile(f);
        if (x != null) {
            res.add(x);
        }
    }
    return res;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:SwitchingJavaFileManger.java

示例4: BootClassPathLocationHandler

BootClassPathLocationHandler() {
    super(StandardLocation.PLATFORM_CLASS_PATH,
            Option.BOOTCLASSPATH, Option.XBOOTCLASSPATH,
            Option.XBOOTCLASSPATH_PREPEND,
            Option.XBOOTCLASSPATH_APPEND,
            Option.ENDORSEDDIRS, Option.DJAVA_ENDORSED_DIRS,
            Option.EXTDIRS, Option.DJAVA_EXT_DIRS);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:Locations.java

示例5: BootClassPathLocationHandler

BootClassPathLocationHandler() {
    super(StandardLocation.PLATFORM_CLASS_PATH,
            Option.BOOT_CLASS_PATH, Option.XBOOTCLASSPATH,
            Option.XBOOTCLASSPATH_PREPEND,
            Option.XBOOTCLASSPATH_APPEND,
            Option.ENDORSEDDIRS, Option.DJAVA_ENDORSED_DIRS,
            Option.EXTDIRS, Option.DJAVA_EXT_DIRS);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:Locations.java

示例6: getJavaFileForInput

@Override
public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind) throws IOException {
    if (location != StandardLocation.PLATFORM_CLASS_PATH || kind != Kind.CLASS)
        return null;

    return className2File.get(className);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:ElementStructureTest.java

示例7: hasLocation

@Override
public boolean hasLocation(Location location) {
    return location == StandardLocation.CLASS_PATH || location == StandardLocation.PLATFORM_CLASS_PATH;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:AsyncJavaSymbolDescriptor.java

示例8: hasLocation

@Override
public boolean hasLocation(Location location) {
    return location == StandardLocation.PLATFORM_CLASS_PATH;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:ElementStructureTest.java


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