Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.JavaModelException


        System.out.println("(" + Thread.currentThread() + ") [JarEntryFile.getContents()] Creating ZipFile on " +zipFile.getName()); //$NON-NLS-1$  //$NON-NLS-2$
      }
      String entryName = getEntryName();
      ZipEntry zipEntry = zipFile.getEntry(entryName);
      if (zipEntry == null){
        throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, entryName));
      }
      byte[] contents = Util.getZipEntryByteContent(zipEntry, zipFile);
      return new ByteArrayInputStream(contents);
    } catch (IOException e){
      throw new JavaModelException(e, IJavaModelStatusConstants.IO_EXCEPTION);
    } finally {
      // avoid leaking ZipFiles
      JavaModelManager.getJavaModelManager().closeZipFile(zipFile);
    }
  }
View Full Code Here


    int uniqueCUs = 0;
    for (int i = 0, length = this.elementsToProcess.length; i < length; i++) {
      IJavaElement e = this.elementsToProcess[i];
      ICompilationUnit cu = getCompilationUnitFor(e);
      if (cu == null) {
        throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.READ_ONLY, e));
      } else {
        IRegion region = (IRegion) this.childrenToRemove.get(cu);
        if (region == null) {
          region = new Region();
          this.childrenToRemove.put(cu, region);
View Full Code Here

}
/*
* @see ISourceManipulation
*/
public void copy(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {
  throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.READ_ONLY, this));
}
View Full Code Here

}
/*
* @see ISourceManipulation
*/
public void move(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {
  throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.READ_ONLY, this));
}
View Full Code Here

}
/*
* @see ISourceManipulation
*/
public void rename(String newName, boolean force, IProgressMonitor monitor) throws JavaModelException {
  throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.READ_ONLY, this));
}
View Full Code Here

/*
* Sets the contents of this element.
* Throws an exception as this element is read only.
*/
public void setContents(String contents, IProgressMonitor monitor) throws JavaModelException {
  throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.READ_ONLY, this));
}
View Full Code Here

          collection.add(r);
          collectAllSubfolders((IFolder)r, collection);
        }
      }
    } catch (CoreException e) {
      throw new JavaModelException(e);
    }
  }
View Full Code Here

              int existingSeverity = ((Integer)cycleMarker.getAttribute(IMarker.SEVERITY)).intValue();
              if (existingSeverity != circularCPSeverity) {
                cycleMarker.setAttribute(IMarker.SEVERITY, circularCPSeverity);
              }
            } catch (CoreException e) {
              throw new JavaModelException(e);
            }
          } else {
            IJavaProject[] projectsInCycle;
            String cycleString = "";   //$NON-NLS-1$
            if (cycleParticipants.isEmpty()) {
View Full Code Here

      xmlWriter.endTag(ClasspathEntry.TAG_CLASSPATH, indent, true/*insert new line*/);
      writer.flush();
      writer.close();
      return s.toString("UTF8");//$NON-NLS-1$
    } catch (IOException e) {
      throw new JavaModelException(e, IJavaModelStatusConstants.IO_EXCEPTION);
    }
  }
View Full Code Here

   * @see IJavaProject#findElement(IPath, WorkingCopyOwner)
   */
  public IJavaElement findElement(IPath path, WorkingCopyOwner owner) throws JavaModelException {

    if (path == null || path.isAbsolute()) {
      throw new JavaModelException(
        new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, path));
    }
    try {

      String extension = path.getFileExtension();
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.JavaModelException

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.