本文整理了Java中org.eclipse.jdt.internal.compiler.util.Util.isClassFileName()
方法的一些代码示例,展示了Util.isClassFileName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.isClassFileName()
方法的具体详情如下:
包路径:org.eclipse.jdt.internal.compiler.util.Util
类名称:Util
方法名:isClassFileName
[英]Returns true iff str.toLowerCase().endsWith(".class") implementation is not creating extra strings.
[中]返回true iff str.toLowerCase()。endsWith(“.class”)实现未创建额外字符串。
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
@Override
public FileVisitResult visitFile(java.nio.file.Path path, java.nio.file.Path mod, BasicFileAttributes attrs)
throws IOException {
String name = path.getFileName().toString();
if (Util.isClassFileName(name) &&
isValidPackageNameForClassOrisModule(name)) {
this.indexedFileNames.put(name, FILE_INDEX_STATE.EXISTS);
}
return FileVisitResult.CONTINUE;
}
@Override
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
@Override
public FileVisitResult visitFile(java.nio.file.Path path, java.nio.file.Path mod, BasicFileAttributes attrs)
throws IOException {
String name = path.getFileName().toString();
if (Util.isClassFileName(name) &&
isValidPackageNameForClassOrisModule(name)) {
this.indexedFileNames.put(name, FILE_INDEX_STATE.EXISTS);
}
return FileVisitResult.CONTINUE;
}
@Override
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
/**
* @see IPackageFragment#getClassFile(String)
* @exception IllegalArgumentException if the name does not end with ".class"
*/
public IClassFile getClassFile(String classFileName) {
if (!org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(classFileName)) {
throw new IllegalArgumentException(Messages.bind(Messages.element_invalidClassFileName, classFileName));
}
// don't hold on the .class file extension to save memory
// also make sure to not use substring as the resulting String may hold on the underlying char[] which might be much bigger than necessary
int length = classFileName.length() - 6;
char[] nameWithoutExtension = new char[length];
classFileName.getChars(0, length, nameWithoutExtension, 0);
return new ClassFile(this, new String(nameWithoutExtension));
}
/**
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
private static IFile findFirstClassFile(IFolder folder) {
try {
IResource[] members = folder.members();
for (int i = 0, max = members.length; i < max; i++) {
IResource member = members[i];
if (member.getType() == IResource.FOLDER) {
return findFirstClassFile((IFolder)member);
} else if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(member.getName())) {
return (IFile) member;
}
}
} catch (CoreException e) {
// ignore
}
return null;
}
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
private static IFile findFirstClassFile(IFolder folder) {
try {
IResource[] members = folder.members();
for (int i = 0, max = members.length; i < max; i++) {
IResource member = members[i];
if (member.getType() == IResource.FOLDER) {
return findFirstClassFile((IFolder)member);
} else if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(member.getName())) {
return (IFile) member;
}
}
} catch (CoreException e) {
// ignore
}
return null;
}
代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps
private static IFile findFirstClassFile(IFolder folder) {
try {
IResource[] members = folder.members();
for (int i = 0, max = members.length; i < max; i++) {
IResource member = members[i];
if (member.getType() == IResource.FOLDER) {
return findFirstClassFile((IFolder)member);
} else if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(member.getName())) {
return (IFile) member;
}
}
} catch (CoreException e) {
// ignore
}
return null;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core
private static IFile findFirstClassFile(IFolder folder) {
try {
IResource[] members = folder.members();
for (int i = 0, max = members.length; i < max; i++) {
IResource member = members[i];
if (member.getType() == IResource.FOLDER) {
return findFirstClassFile((IFolder)member);
} else if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(member.getName())) {
return (IFile) member;
}
}
} catch (CoreException e) {
// ignore
}
return null;
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core
private static IFile findFirstClassFile(IFolder folder) {
try {
IResource[] members = folder.members();
for (int i = 0, max = members.length; i < max; i++) {
IResource member = members[i];
if (member.getType() == IResource.FOLDER) {
return findFirstClassFile((IFolder)member);
} else if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(member.getName())) {
return (IFile) member;
}
}
} catch (CoreException e) {
// ignore
}
return null;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
@Override
public void indexDocument(SearchDocument document, IPath indexPath) {
// TODO must verify that the document + indexPath match, when this is not called from scheduleDocumentIndexing
document.removeAllIndexEntries(); // in case the document was already indexed
String documentPath = document.getPath();
if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(documentPath)) {
this.sourceIndexer = new SourceIndexer(document);
this.sourceIndexer.indexDocument();
} else if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(documentPath)) {
new BinaryIndexer(document).indexDocument();
} else if (documentPath.endsWith(TypeConstants.AUTOMATIC_MODULE_NAME)) {
new ManifestIndexer(document).indexDocument();
}
}
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
public void indexDocument(SearchDocument document, IPath indexPath) {
// TODO must verify that the document + indexPath match, when this is not called from scheduleDocumentIndexing
document.removeAllIndexEntries(); // in case the document was already indexed
String documentPath = document.getPath();
if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(documentPath)) {
this.sourceIndexer = new SourceIndexer(document);
this.sourceIndexer.indexDocument();
} else if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(documentPath)) {
new BinaryIndexer(document).indexDocument();
}
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
public void indexDocument(SearchDocument document, IPath indexPath) {
// TODO must verify that the document + indexPath match, when this is not called from scheduleDocumentIndexing
document.removeAllIndexEntries(); // in case the document was already indexed
String documentPath = document.getPath();
if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(documentPath)) {
this.sourceIndexer = new SourceIndexer(document);
this.sourceIndexer.indexDocument();
} else if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(documentPath)) {
new BinaryIndexer(document).indexDocument();
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core
public void indexDocument(SearchDocument document, IPath indexPath) {
// TODO must verify that the document + indexPath match, when this is not called from scheduleDocumentIndexing
document.removeAllIndexEntries(); // in case the document was already indexed
String documentPath = document.getPath();
if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(documentPath)) {
this.sourceIndexer = new SourceIndexer(document);
this.sourceIndexer.indexDocument();
} else if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(documentPath)) {
new BinaryIndexer(document).indexDocument();
}
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core
public void indexDocument(SearchDocument document, IPath indexPath) {
// TODO must verify that the document + indexPath match, when this is not called from scheduleDocumentIndexing
document.removeAllIndexEntries(); // in case the document was already indexed
String documentPath = document.getPath();
if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(documentPath)) {
new SourceIndexer(document).indexDocument();
} else if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(documentPath)) {
new BinaryIndexer(document).indexDocument();
}
}
代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion
public void indexDocument(SearchDocument document, IPath indexPath) {
// TODO must verify that the document + indexPath match, when this is not called from scheduleDocumentIndexing
document.removeAllIndexEntries(); // in case the document was already indexed
String documentPath = document.getPath();
if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(documentPath)) {
this.sourceIndexer = new SourceIndexer(document);
this.sourceIndexer.indexDocument();
} else if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(documentPath)) {
new BinaryIndexer(document).indexDocument();
}
}
代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core
public boolean visit(IResourceProxy proxy) {
if (IndexBinaryFolder.this.isCancelled) return false;
if (proxy.getType() == IResource.FILE) {
if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(proxy.getName())) {
IFile file = (IFile) proxy.requestResource();
String containerRelativePath = Util.relativePath(file.getFullPath(), IndexBinaryFolder.this.containerPath.segmentCount());
indexedFileNames.put(containerRelativePath, file);
}
return false;
}
return true;
}
}, IResource.NONE);
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
public boolean visit(IResourceProxy proxy) {
if (IndexBinaryFolder.this.isCancelled) return false;
if (proxy.getType() == IResource.FILE) {
if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(proxy.getName())) {
IFile file = (IFile) proxy.requestResource();
String containerRelativePath = Util.relativePath(file.getFullPath(), IndexBinaryFolder.this.containerPath.segmentCount());
indexedFileNames.put(containerRelativePath, file);
}
return false;
}
return true;
}
}, IResource.NONE);
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core
public boolean visit(IResourceProxy proxy) {
if (IndexBinaryFolder.this.isCancelled) return false;
if (proxy.getType() == IResource.FILE) {
if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(proxy.getName())) {
IFile file = (IFile) proxy.requestResource();
String containerRelativePath = Util.relativePath(file.getFullPath(), IndexBinaryFolder.this.containerPath.segmentCount());
indexedFileNames.put(containerRelativePath, file);
}
return false;
}
return true;
}
}, IResource.NONE);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core
public boolean visit(IResourceProxy proxy) {
if (IndexBinaryFolder.this.isCancelled) return false;
if (proxy.getType() == IResource.FILE) {
if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(proxy.getName())) {
IFile file = (IFile) proxy.requestResource();
String containerRelativePath = Util.relativePath(file.getFullPath(), IndexBinaryFolder.this.containerPath.segmentCount());
indexedFileNames.put(containerRelativePath, file);
}
return false;
}
return true;
}
}, IResource.NONE);
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
@Override
public boolean visit(IResourceProxy proxy) {
if (IndexBinaryFolder.this.isCancelled) return false;
if (proxy.getType() == IResource.FILE) {
if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(proxy.getName())) {
IFile file = (IFile) proxy.requestResource();
String containerRelativePath = Util.relativePath(file.getFullPath(), IndexBinaryFolder.this.containerPath.segmentCount());
indexedFileNames.put(containerRelativePath, file);
}
return false;
}
return true;
}
}, IResource.NONE);
代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion
public boolean visit(IResourceProxy proxy) {
if (IndexBinaryFolder.this.isCancelled) return false;
if (proxy.getType() == IResource.FILE) {
if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(proxy.getName())) {
IFile file = (IFile) proxy.requestResource();
String containerRelativePath = Util.relativePath(file.getFullPath(), IndexBinaryFolder.this.containerPath.segmentCount());
indexedFileNames.put(containerRelativePath, file);
}
return false;
}
return true;
}
}, IResource.NONE);
内容来源于网络,如有侵权,请联系作者删除!