Package org.aspectj.org.eclipse.jdt.internal.core

Examples of org.aspectj.org.eclipse.jdt.internal.core.PackageFragmentRoot


  // create a temporary info
  IBinaryType info;
  try {
    PackageFragment pkg = (PackageFragment) classFile.getParent();
    PackageFragmentRoot root = (PackageFragmentRoot) pkg.getParent();
    if (root.isArchive()) {
      // class file in a jar
      String classFileName = classFile.getElementName();
      String classFilePath = Util.concatWith(pkg.names, classFileName, '/');
      ZipFile zipFile = null;
      try {
View Full Code Here


  int length = roots.length;
  ClasspathLocation[] cpLocations = new ClasspathLocation[length];
  int index = 0;
  JavaModelManager manager = JavaModelManager.getJavaModelManager();
  for (int i = 0; i < length; i++) {
    PackageFragmentRoot root = (PackageFragmentRoot) roots[i];
    IPath path = root.getPath();
    try {
      if (root.isArchive()) {
        ZipFile zipFile = manager.getZipFile(path);
        cpLocations[index++] = new ClasspathJar(zipFile, ((ClasspathEntry) root.getRawClasspathEntry()).getAccessRuleSet());
      } else {
        Object target = JavaModel.getTarget(workspaceRoot, path, false);
        if (target == null) {
          // target doesn't exist any longer
          // just resize cpLocations
          System.arraycopy(cpLocations, 0, cpLocations = new ClasspathLocation[cpLocations.length-1], 0, index);
        } else if (root.getKind() == IPackageFragmentRoot.K_SOURCE) {
          cpLocations[index++] = new ClasspathSourceDirectory((IContainer)target, root.fullExclusionPatternChars(), root.fullInclusionPatternChars());
        } else {
          cpLocations[index++] = ClasspathLocation.forBinaryFolder((IContainer) target, false, ((ClasspathEntry) root.getRawClasspathEntry()).getAccessRuleSet());
        }
      }
    } catch (CoreException e1) {
      // problem opening zip file or getting root kind
      // consider root corrupt and ignore
View Full Code Here

        if (!project.isAccessible()
          || !project.hasNature(JavaCore.NATURE_ID)) continue;
        IJavaProject javaProject= this.javaModel.getJavaProject(project);
        IPackageFragmentRoot[] roots= javaProject.getPackageFragmentRoots();
        for (int j= 0, rootCount= roots.length; j < rootCount; j++) {
          PackageFragmentRoot root= (PackageFragmentRoot)roots[j];
          if (root.getPath().isPrefixOf(path) && !Util.isExcluded(path, root.fullInclusionPatternChars(), root.fullExclusionPatternChars(), false)) {
            return root;
          }
        }
      } catch (CoreException e) {
        // CoreException from hasNature - should not happen since we check that the project is accessible
View Full Code Here

      case IJavaElement.JAVA_PROJECT:
      case IJavaElement.PACKAGE_FRAGMENT_ROOT:
        return false;

      case IJavaElement.PACKAGE_FRAGMENT:
        PackageFragmentRoot root = (PackageFragmentRoot)element.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
        IResource resource = element.getResource();
        return resource != null && isExcluded(resource, root.fullInclusionPatternChars(), root.fullExclusionPatternChars());
       
      case IJavaElement.COMPILATION_UNIT:
        root = (PackageFragmentRoot)element.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
        resource = element.getResource();
        if (resource == null)
          return false;
        if (isExcluded(resource, root.fullInclusionPatternChars(), root.fullExclusionPatternChars()))
          return true;
        return isExcluded(element.getParent());
       
      default:
        IJavaElement cu = element.getAncestor(IJavaElement.COMPILATION_UNIT);
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.core.PackageFragmentRoot

Copyright © 2018 www.massapicom. 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.