Examples of IClasspathEntry


Examples of org.aspectj.org.eclipse.jdt.core.IClasspathEntry

           
        // check to see if any of the modified variables is present on the classpath
        IClasspathEntry[] classpath = project.getRawClasspath();
        for (int j = 0, cpLength = classpath.length; j < cpLength; j++){
         
          IClasspathEntry entry = classpath[j];
          for (int k = 0; k < varLength; k++){
 
            String variableName = this.variableNames[k];           
            if (entry.getEntryKind() ==  IClasspathEntry.CPE_VARIABLE){
 
              if (variableName.equals(entry.getPath().segment(0))){
                affectedProjectClasspaths.put(project, project.getResolvedClasspath());
                continue nextProject;
              }
              IPath sourcePath, sourceRootPath;
              if (((sourcePath = entry.getSourceAttachmentPath()) != null  && variableName.equals(sourcePath.segment(0)))
                || ((sourceRootPath = entry.getSourceAttachmentRootPath()) != null  && variableName.equals(sourceRootPath.segment(0)))) {
 
                affectedProjectClasspaths.put(project, project.getResolvedClasspath());
                continue nextProject;
              }
            }                       
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IClasspathEntry

        if (newContainer == null) newContainer = JavaModelManager.CONTAINER_INITIALIZATION_IN_PROGRESS; // 30920 - prevent infinite loop
        boolean found = false;
        if (JavaProject.hasJavaNature(affectedProject.getProject())){
          IClasspathEntry[] rawClasspath = affectedProject.getRawClasspath();
          for (int j = 0, cpLength = rawClasspath.length; j <cpLength; j++) {
            IClasspathEntry entry = rawClasspath[j];
            if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER && entry.getPath().equals(this.containerPath)){
              found = true;
              break;
            }
          }
        }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IClasspathEntry

    for (int i = 0; i < length - 1; i++) {
      if (!otherClasspathWithOutput[i].equals(newClasspath[i]))
        return false;
    }
    // compare binary outputs
    IClasspathEntry output = otherClasspathWithOutput[length - 1];
    if (output.getContentKind() != ClasspathEntry.K_OUTPUT
        || !output.getPath().equals(newOutputLocation))
      return false;
    return true;
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IClasspathEntry

      return false;
    }
   
    IPath fullPath = resource.getFullPath();
    IPath innerMostOutput = output.isPrefixOf(fullPath) ? output : null;
    IClasspathEntry innerMostEntry = null;
    for (int j = 0, cpLength = classpath.length; j < cpLength; j++) {
      IClasspathEntry entry = classpath[j];
   
      IPath entryPath = entry.getPath();
      if ((innerMostEntry == null || innerMostEntry.getPath().isPrefixOf(entryPath))
          && entryPath.isPrefixOf(fullPath)) {
        innerMostEntry = entry;
      }
      IPath entryOutput = classpath[j].getOutputLocation();
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IClasspathEntry

   * Reads and decode an XML classpath string
   */
  public IClasspathEntry[] decodeClasspath(String xmlClasspath, Map unknownElements) throws IOException, AssertionFailedException {
 
    ArrayList paths = new ArrayList();
    IClasspathEntry defaultOutput = null;
    StringReader reader = new StringReader(xmlClasspath);
    Element cpElement;
    try {
      DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
      cpElement = parser.parse(new InputSource(reader)).getDocumentElement();
    } catch (SAXException e) {
      throw new IOException(Messages.file_badFormat);
    } catch (ParserConfigurationException e) {
      throw new IOException(Messages.file_badFormat);
    } finally {
      reader.close();
    }
 
    if (!cpElement.getNodeName().equalsIgnoreCase("classpath")) { //$NON-NLS-1$
      throw new IOException(Messages.file_badFormat);
    }
    NodeList list = cpElement.getElementsByTagName("classpathentry"); //$NON-NLS-1$
    int length = list.getLength();
 
    for (int i = 0; i < length; ++i) {
      Node node = list.item(i);
      if (node.getNodeType() == Node.ELEMENT_NODE) {
        IClasspathEntry entry = ClasspathEntry.elementDecode((Element)node, this, unknownElements);
        if (entry != null){
          if (entry.getContentKind() == ClasspathEntry.K_OUTPUT) {
            defaultOutput = entry; // separate output
          } else {
            paths.add(entry);
      }
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IClasspathEntry

    IPath elementPath = element.getPath();
   
    // first look at unresolved entries
    int length = rawClasspath.length;
    for (int i = 0; i < length; i++) {
      IClasspathEntry entry = rawClasspath[i];
      switch (entry.getEntryKind()) {
        case IClasspathEntry.CPE_LIBRARY:
        case IClasspathEntry.CPE_PROJECT:
        case IClasspathEntry.CPE_SOURCE:
          if (isOnClasspathEntry(elementPath, isFolderPath, isPackageFragmentRoot, entry))
            return true;
          break;
      }
    }
   
    // no need to go further for compilation units and elements inside a compilation unit
    // it can only be in a source folder, thus on the raw classpath
    if (isSource)
      return false;
   
    // then look at resolved entries
    for (int i = 0; i < length; i++) {
      IClasspathEntry rawEntry = rawClasspath[i];
      switch (rawEntry.getEntryKind()) {
        case IClasspathEntry.CPE_CONTAINER:
          IClasspathContainer container;
          try {
            container = JavaCore.getClasspathContainer(rawEntry.getPath(), this);
          } catch (JavaModelException e) {
            break;
          }
          if (container == null)
            break;
          IClasspathEntry[] containerEntries = container.getClasspathEntries();
          if (containerEntries == null)
            break;
          // container was bound
          for (int j = 0, containerLength = containerEntries.length; j < containerLength; j++){
            IClasspathEntry resolvedEntry = containerEntries[j];
            if (resolvedEntry == null) {
              if (JavaModelManager.CP_RESOLVE_VERBOSE) {
                JavaModelManager.getJavaModelManager().verbose_missbehaving_container(this, rawEntry.getPath(), containerEntries);
              }
              return false;
            }
            if (isOnClasspathEntry(elementPath, isFolderPath, isPackageFragmentRoot, resolvedEntry))
              return true;
          }         
          break;
        case IClasspathEntry.CPE_VARIABLE:
          IClasspathEntry resolvedEntry = JavaCore.getResolvedClasspathEntry(rawEntry);
          if (resolvedEntry == null)
            break;
          if (isOnClasspathEntry(elementPath, isFolderPath, isPackageFragmentRoot, resolvedEntry))
            return true;
          break;
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IClasspathEntry

      classpath = this.getResolvedClasspath();
    } catch(JavaModelException e){
      return false; // not a Java project
    }
    for (int i = 0; i < classpath.length; i++) {
      IClasspathEntry entry = classpath[i];
      IPath entryPath = entry.getPath();
      if (entryPath.equals(exactPath)) { // package fragment roots must match exactly entry pathes (no exclusion there)
        return true;
      }
      if (entryPath.isPrefixOf(path)
          && !Util.isExcluded(path, ((ClasspathEntry)entry).fullInclusionPatternChars(), ((ClasspathEntry)entry).fullExclusionPatternChars(), isFolderPath)) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IClasspathEntry

     
    ArrayList prerequisites = new ArrayList();
    // need resolution
    entries = resolveClasspath(entries);
    for (int i = 0, length = entries.length; i < length; i++) {
      IClasspathEntry entry = entries[i];
      if (entry.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
        prerequisites.add(entry.getPath().lastSegment());
      }
    }
    int size = prerequisites.size();
    if (size == 0) {
      return NO_PREREQUISITES;
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IClasspathEntry

      return defaultOutputLocation();
   
    // extract the output location
    IPath outputLocation = null;
    if (classpath.length > 0) {
      IClasspathEntry entry = classpath[classpath.length - 1];
      if (entry.getContentKind() == ClasspathEntry.K_OUTPUT) {
        outputLocation = entry.getPath();
      }
    }
    return outputLocation;
  }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.IClasspathEntry

    if (classpath == JavaProject.INVALID_CLASSPATH)
      return defaultClasspath();
   
    // discard the output location
    if (classpath.length > 0) {
      IClasspathEntry entry = classpath[classpath.length - 1];
      if (entry.getContentKind() == ClasspathEntry.K_OUTPUT) {
        IClasspathEntry[] copy = new IClasspathEntry[classpath.length - 1];
        System.arraycopy(classpath, 0, copy, 0, copy.length);
        classpath = copy;
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.