public ClasspathJar(String fileName, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, boolean isOnModulePath) { this(fileName, 0, accessRuleSet, externalAnnotationPath, isOnModulePath); if (externalAnnotationPath != null) this.externalAnnotationPath = externalAnnotationPath.toString(); }
ClasspathJar(String zipFilename, long lastModified, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, boolean isOnModulePath) { this.zipFilename = zipFilename; this.lastModified = lastModified; this.zipFile = null; this.knownPackageNames = null; this.accessRuleSet = accessRuleSet; if (externalAnnotationPath != null) this.externalAnnotationPath = externalAnnotationPath.toString(); this.isOnModulePath = isOnModulePath; }
public static StringBuffer appendEncodePath(IPath path, StringBuffer buf) { if (path != null) { String str= path.toString(); buf.append('[').append(str.length()).append(']').append(str); } else { buf.append('[').append(']'); } return buf; }
/** * @see org.eclipse.jdt.internal.compiler.env.IDependent#getFileName() */ @Override public char[] getFileName(){ return getPath().toString().toCharArray(); }
@Override public String toString() { String start = "Binary classpath directory " + this.binaryFolder.getFullPath().toString(); //$NON-NLS-1$ if (this.accessRuleSet == null) return start; return start + " with " + this.accessRuleSet; //$NON-NLS-1$ }
@Override public boolean belongsTo(String projectNameOrJarPath) { // used to remove pending jobs because the project was deleted... not to delete index files // can be found either by project name or JAR path name return projectNameOrJarPath.equals(this.containerPath.segment(0)) || projectNameOrJarPath.equals(this.containerPath.toString()); } @Override
@Override public String toString() { String s = resource == null ? "null" : resource.getFullPath().toString(); //$NON-NLS-1$ return "Node: " + s; //$NON-NLS-1$ } }
@Override protected IBinaryType createInfoFromClassFile(Openable classFile, IResource file) { String documentPath = classFile.getPath().toString(); IBinaryType binaryType = (IBinaryType)this.binariesFromIndexMatches.get(documentPath); if (binaryType != null) { this.infoToHandle.put(binaryType, classFile); return binaryType; } else { return super.createInfoFromClassFile(classFile, file); } } @Override
protected IBinaryType createInfoFromClassFile(Openable classFile, IResource file) { String documentPath = classFile.getPath().toString(); IBinaryType binaryType = (IBinaryType)this.binariesFromIndexMatches.get(documentPath); if (binaryType != null) { this.infoToHandle.put(binaryType, classFile); return binaryType; } else { return super.createInfoFromClassFile(classFile, file); } } protected IBinaryType createInfoFromClassFileInJar(Openable classFile) {
public char[][] fullInclusionPatternChars() { if (this.fullInclusionPatternChars == UNINIT_PATTERNS) { int length = this.inclusionPatterns.length; this.fullInclusionPatternChars = new char[length][]; IPath prefixPath = this.path.removeTrailingSeparator(); for (int i = 0; i < length; i++) { this.fullInclusionPatternChars[i] = prefixPath.append(this.inclusionPatterns[i]).toString().toCharArray(); } } return this.fullInclusionPatternChars; }
boolean isSourceFolderEmpty(IContainer sourceFolder) { String sourceFolderName = sourceFolder.getProjectRelativePath().addTrailingSeparator().toString(); Object[] table = this.typeLocators.valueTable; for (int i = 0, l = table.length; i < l; i++) if (table[i] != null && ((String) table[i]).startsWith(sourceFolderName)) return false; return true; }
public char[][] fullExclusionPatternChars() { if (this.fullExclusionPatternChars == UNINIT_PATTERNS) { int length = this.exclusionPatterns.length; this.fullExclusionPatternChars = new char[length][]; IPath prefixPath = this.path.removeTrailingSeparator(); for (int i = 0; i < length; i++) { this.fullExclusionPatternChars[i] = prefixPath.append(this.exclusionPatterns[i]).toString().toCharArray(); } } return this.fullExclusionPatternChars; }
WorkingCopyDocument(org.eclipse.jdt.core.ICompilationUnit workingCopy, SearchParticipant participant) { super(workingCopy.getPath().toString(), participant); this.charContents = ((CompilationUnit)workingCopy).getContents(); this.workingCopy = workingCopy; } @Override
private PropertyEntry getEntry(IPath path) { String pathAsString = path.toString(); String[][] existing = (String[][]) getEntryValue(pathAsString); if (existing == null) return null; return new PropertyEntry(path, existing); }
public static ClassFileReader newClassFileReader(IResource resource) throws CoreException, ClassFormatException, IOException { InputStream in = null; try { in = ((IFile) resource).getContents(true); return ClassFileReader.read(in, resource.getFullPath().toString()); } finally { if (in != null) in.close(); } }
private IAccessRule loadAccessRule() throws IOException { int problemId = loadInt(); IPath pattern = loadPath(); return new ClasspathAccessRule(pattern.toString().toCharArray(), problemId); }
private void attachWorkspaceFilesToResource(List<IJavaElement> elementsMappingOntoLocation, NdResourceFile resourceFile) { for (IJavaElement next : elementsMappingOntoLocation) { IResource nextResource = next.getResource(); if (nextResource != null) { new NdWorkspaceLocation(this.nd, resourceFile, nextResource.getFullPath().toString().toCharArray()); } } }
/** * Notification before a compile that a unit is about to be compiled. */ public void aboutToCompile(SourceFile unit) { String message = Messages.bind(Messages.build_compiling, unit.resource.getFullPath().removeLastSegments(1).makeRelative().toString()); subTask(message); }
/** * Trigger addition of a resource to an index * Note: the actual operation is performed in background */ public void addBinary(IFile resource, IPath containerPath) { if (JavaCore.getPlugin() == null) return; SearchParticipant participant = SearchEngine.getDefaultSearchParticipant(); SearchDocument document = participant.getDocument(resource.getFullPath().toString()); IndexLocation indexLocation = computeIndexLocation(containerPath); scheduleDocumentIndexing(document, containerPath, indexLocation, participant); } /**
/** * Trigger addition of a resource to an index * Note: the actual operation is performed in background */ public void addBinary(IFile resource, IPath containerPath) { if (JavaCore.getPlugin() == null) return; SearchParticipant participant = SearchEngine.getDefaultSearchParticipant(); SearchDocument document = participant.getDocument(resource.getFullPath().toString()); IndexLocation indexLocation = computeIndexLocation(containerPath); scheduleDocumentIndexing(document, containerPath, indexLocation, participant); } /**