本文整理汇总了Java中javax.tools.StandardLocation.PATCH_MODULE_PATH属性的典型用法代码示例。如果您正苦于以下问题:Java StandardLocation.PATCH_MODULE_PATH属性的具体用法?Java StandardLocation.PATCH_MODULE_PATH怎么用?Java StandardLocation.PATCH_MODULE_PATH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.tools.StandardLocation
的用法示例。
在下文中一共展示了StandardLocation.PATCH_MODULE_PATH属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLocationForModule
@Override
public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
if (location == StandardLocation.PATCH_MODULE_PATH) {
final URL url = fo.toUri().toURL();
for (Map.Entry<URL,String> root : roots.entrySet()) {
if (FileObjects.isParentOf(root.getKey(), url)) {
String modName = root.getValue();
return moduleLocations(location).stream()
.filter((ml) -> modName.equals(ml.getModuleName()))
.findFirst()
.orElse(null);
}
}
}
return null;
}
示例2: createPatchLocation
@NonNull
private static PatchLocation createPatchLocation(
@NonNull final String modName,
@NonNull final List<? extends URL> roots) {
Collection<URL> bin = new ArrayList<>(roots.size());
Collection<URL> src = new ArrayList<>(roots.size());
for (URL root : roots) {
if (JavaIndex.hasSourceCache(root, false)) {
src.add(root);
} else {
bin.add(root);
}
}
return new PatchLocation(
StandardLocation.PATCH_MODULE_PATH,
bin,
src,
modName);
}
示例3: listLocationsForModules
@Override
public Iterable<Set<Location>> listLocationsForModules(Location location) throws IOException {
if (location == StandardLocation.PATCH_MODULE_PATH) {
return moduleLocations(location).stream()
.map((ml) -> Collections.<Location>singleton(ml))
.collect(Collectors.toList());
} else {
return Collections.emptyList();
}
}
示例4: moduleLocations
private Set<PatchLocation> moduleLocations(final Location baseLocation) {
if (baseLocation != StandardLocation.PATCH_MODULE_PATH) {
throw new IllegalStateException(baseLocation.toString());
}
if (moduleLocations == null) {
Set<PatchLocation> res = new HashSet<>();
for (Map.Entry<String,List<URL>> patch : patches.entrySet()) {
res.add(createPatchLocation(patch.getKey(), patch.getValue()));
}
moduleLocations = Collections.unmodifiableSet(res);
}
return moduleLocations;
}
示例5: hasLocation
@Override
public boolean hasLocation(Location location) {
return (StandardLocation.PATCH_MODULE_PATH == location || StandardLocation.CLASS_OUTPUT == location)
&& !patches.isEmpty();
}
示例6: hasLocation
@Override @DefinedBy(Api.COMPILER)
public boolean hasLocation(Location location) {
return location == StandardLocation.PATCH_MODULE_PATH ||
super.hasLocation(location);
}
示例7: PatchModulesLocationHandler
PatchModulesLocationHandler() {
super(StandardLocation.PATCH_MODULE_PATH, Option.PATCH_MODULE);
}
示例8: hasLocation
@Override
public boolean hasLocation(Location location) {
return super.hasLocation(location) || location == StandardLocation.PATCH_MODULE_PATH;
}