本文整理汇总了Java中org.netbeans.api.java.classpath.ClassPath.EMPTY属性的典型用法代码示例。如果您正苦于以下问题:Java ClassPath.EMPTY属性的具体用法?Java ClassPath.EMPTY怎么用?Java ClassPath.EMPTY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.netbeans.api.java.classpath.ClassPath
的用法示例。
在下文中一共展示了ClassPath.EMPTY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getClassPath
@Override
public ClassPath getClassPath(String type) {
androidProject.getCompileTarget();
if (type.equals(ClassPath.SOURCE)) {
return source;
} else if (type.equals(ClassPath.BOOT)) {
if (androidProject.getBootClasspath().isEmpty()) {
return ClassPath.EMPTY;
}
String next = androidProject.getBootClasspath().iterator().next();
AndroidJavaPlatform findPlatform = AndroidJavaPlatformProvider.findPlatform(next, androidProject.getCompileTarget());
if (findPlatform != null) {
return findPlatform.getBootstrapLibraries();
}
return ClassPath.EMPTY;
} else if (type.equals(ClassPath.COMPILE)) {
return compile;
} else if (type.equals(ClassPath.EXECUTE)) {
return execute;
} else {
return null;
}
}
示例2: getClassPath
public synchronized static final ClassPath getClassPath(final String id, URL[] urls) {
if (urls.length == 0) {
return ClassPath.EMPTY;
} else {
ClassPath tmp[] = new ClassPath[urls.length];
for (int i = 0; i < urls.length; i++) {
ClassPath classPath = cache.get(urls[i]);
if (classPath == null) {
classPath = ClassPathSupport.createClassPath(urls[i]);
cache.put(urls[i], classPath);
}
tmp[i] = classPath;
}
return ClassPathSupport.createProxyClassPath(tmp);
}
}
示例3: findClassPath
@Override
public ClassPath findClassPath(FileObject file, String type) {
final FileObject _root = root;
if (_root != null && (_root.equals(file) || FileUtil.isParentOf(_root, file))) {
switch (type) {
case ClassPath.SOURCE:
return ClassPathSupport.createClassPath(_root);
case ClassPath.COMPILE:
return ClassPath.EMPTY;
case ClassPath.BOOT:
return ClassPathSupport.createClassPath(System.getProperty("sun.boot.class.path")); //NOI18N
}
}
return null;
}
示例4: setModuleBootPath
@NonNull
public Builder setModuleBootPath(@NullAllowed ClassPath moduleBootPath) {
if (moduleBootPath == null) {
moduleBootPath = ClassPath.EMPTY;
}
this.moduleBootPath = moduleBootPath;
return this;
}
示例5: setModuleSourcePath
@NonNull
public Builder setModuleSourcePath(@NullAllowed ClassPath moduleSourcePath) {
if (moduleSourcePath == null) {
moduleSourcePath = ClassPath.EMPTY;
}
this.moduleSourcePath = moduleSourcePath;
return this;
}
示例6: setSourcePath
@NonNull
public Builder setSourcePath(@NullAllowed ClassPath sourcePath) {
if (sourcePath == null) {
sourcePath = ClassPath.EMPTY;
}
this.sourcePath = sourcePath;
return this;
}
示例7: getActiveClassPath
@Override
protected ClassPath getActiveClassPath(boolean hasTestModuleDescriptor, boolean hasMainModuleDescriptor) {
// see how modulepathElements are set in org.apache.maven.plugin.compiler.TestCompilerMojo
// XXX at the moment the asumption is made that exec-maven-plugin (runtime) will follow symetric logic like maven-compiler-plugin
if ( hasTestModuleDescriptor ) {
return testPath.get();
} else {
if(hasMainModuleDescriptor) {
return path.get();
} else {
return ClassPath.EMPTY;
}
}
}
示例8: runIndexing
protected ParsingOutput runIndexing(List<CompileTuple> files, List<CompileTuple> virtualFiles) throws Exception {
TransactionContext txc = TransactionContext.beginStandardTransaction(src.toURL(), true, false, false);
Factory f = new JavaCustomIndexer.Factory();
Context ctx = SPIAccessor.getInstance().createContext(CacheFolder.getDataFolder(src.toURL()), src.toURL(), f.getIndexerName(), f.getIndexVersion(), LuceneIndexFactory.getDefault(), false, false, true, SPIAccessor.getInstance().createSuspendStatus(new SuspendStatusImpl() {
@Override
public boolean isSuspendSupported() {
return true;
}
@Override public boolean isSuspended() {
return false;
}
@Override public void parkWhileSuspended() throws InterruptedException { }
}), new CancelRequest() {
@Override public boolean isRaised() {
return false;
}
}, LogContext.create(EventType.PATH, ""));
JavaParsingContext javaContext = new JavaParsingContext(ctx, ClassPathSupport.createClassPath(SourceUtilsTestUtil.getBootClassPath().toArray(new URL[0])), ClassPath.EMPTY, ClassPathSupport.createClassPath(new FileObject[0]), ClassPath.EMPTY, ClassPath.EMPTY, ClassPathSupport.createClassPath(new FileObject[] {src}), ClassPath.EMPTY, virtualFiles);
List<CompileTuple> toIndex = new ArrayList<CompileTuple>();
toIndex.addAll(files);
toIndex.addAll(virtualFiles);
ParsingOutput result = runCompileWorker(ctx, javaContext, toIndex);
txc.commit();
return result;
}
示例9: createSrcFileManager
@CheckForNull
private JavaFileManager createSrcFileManager() {
if (emitted[SRC] == null) {
final boolean srcNonEmpty = !this.srcCached.entries().isEmpty();
final boolean hasModules = srcNonEmpty && this.moduleSrcCached != ClassPath.EMPTY;
final boolean hasSources = !hasModules && srcNonEmpty;
emitted[SRC] = hasSources ?
(!useModifiedFiles ?
new CachingFileManager (cap, srcCached, filter, null, false, ignoreExcludes) :
new SourceFileManager (srcCached, ignoreExcludes)) :
null;
}
return emitted[SRC];
}
示例10: setModuleClassPath
@NonNull
public Builder setModuleClassPath(@NullAllowed ClassPath moduleClassPath) {
if (moduleClassPath == null) {
moduleClassPath = ClassPath.EMPTY;
}
this.moduleClassPath = moduleClassPath;
return this;
}
示例11: createPatchFileManager
@CheckForNull
private JavaFileManager createPatchFileManager() {
if (emitted[MODULE_PATCHES] == null) {
emitted[MODULE_PATCHES] = new PatchModuleFileManager(
new ModuleFileManager(cap, ClassPath.EMPTY, ROOT_TO_COLLECTION, sourceLevel, StandardLocation.MODULE_PATH, false),
new ModuleSourceFileManager(ClassPath.EMPTY, ClassPath.EMPTY, ignoreExcludes)
);
}
return emitted[MODULE_PATCHES];
}
示例12: init
private void init(final FileObject workDir) throws IOException {
src = FileUtil.createFolder(
workDir,
"src"); //NOI18N
sourcesImpl = ClassPathSupport.createClassPathImplementation(
Collections.singletonList(ClassPathSupport.createResource(src.toURL())));
sources = ClassPathFactory.createClassPath(sourcesImpl);
boot = JavaPlatform.getDefault().getBootstrapLibraries();
compile = ClassPath.EMPTY;
final MockClassPathProvider cpp = Lookup.getDefault().lookup(MockClassPathProvider.class);
if (cpp == null) {
throw new IllegalStateException("No ClasspathProvider"); //NOI18N
}
cpp.setUp(src, boot, compile, sources);
}
示例13: getStandardLibraries
@Override
public ClassPath getStandardLibraries() {
return ClassPath.EMPTY;
}
示例14: getSourceFolders
@Override
public ClassPath getSourceFolders() {
return ClassPath.EMPTY;
}
示例15: testGetDependentRootsJavaLikeDependenciesWithPeerRoots
public void testGetDependentRootsJavaLikeDependenciesWithPeerRoots() throws IOException, InterruptedException {
final FileObject wd = FileUtil.toFileObject(getWorkDir());
final FileObject src1a = FileUtil.createFolder(wd,"src1a"); //NOI18N
final FileObject src1b = FileUtil.createFolder(wd,"src1b"); //NOI18N
final ClassPath src1Source = ClassPathSupport.createClassPath(src1a, src1b);
final ClassPath boot = ClassPath.EMPTY;
final Map<String,ClassPath> src1cps = new HashMap<String, ClassPath>();
src1cps.put(JavaLikePathRecognizer.BOOT, boot);
src1cps.put(JavaLikePathRecognizer.COMPILE, ClassPath.EMPTY);
src1cps.put(JavaLikePathRecognizer.SRC, src1Source);
final Map<FileObject,Map<String,ClassPath>> cps = new HashMap<FileObject, Map<String, ClassPath>>();
cps.put(src1a,src1cps);
cps.put(src1b,src1cps);
ClassPathProviderImpl.register(cps);
globalPathRegistry_register(
JavaLikePathRecognizer.BOOT,
new ClassPath[]{
boot
});
globalPathRegistry_register(
JavaLikePathRecognizer.SRC,
new ClassPath[]{
src1Source
});
RepositoryUpdater.getDefault().waitUntilFinished(RepositoryUpdaterTest.TIME);
assertEquals(
IndexingController.getDefault().getRootDependencies().keySet().toString(),
2,
IndexingController.getDefault().getRootDependencies().size());
assertEquals(new FileObject[] {src1a, src1b}, QuerySupport.findDependentRoots(src1a, true));
assertEquals(new FileObject[] {src1a, src1b}, QuerySupport.findDependentRoots(src1b, true));
assertEquals(new FileObject[] {src1a, src1b}, QuerySupport.findDependentRoots(src1a, false));
assertEquals(new FileObject[] {src1a, src1b}, QuerySupport.findDependentRoots(src1b, false));
}