Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.JavaModelException


    // delete remaining files in this package (.class file in the case where Proj=src=bin)
    IResource[] remainingFiles;
    try {
      remainingFiles = ((IContainer) res).members();
    } catch (CoreException ce) {
      throw new JavaModelException(ce);
    }
    boolean isEmpty = true;
    for (int i = 0, length = remainingFiles.length; i < length; i++) {
      IResource file = remainingFiles[i];
      if (file instanceof IFile && org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(file.getName())) {
View Full Code Here


      break;
    case IJavaElement.PACKAGE_FRAGMENT :
      deletePackageFragment((IPackageFragment) element);
      break;
    default :
      throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_ELEMENT_TYPES, element));
  }
  // ensure the element is closed
  if (element instanceof IOpenable) {
    ((IOpenable)element).close();
  }
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

        resolvedClasspath = temporaryInfo.getResolvedClasspath();
        unresolvedEntryStatus = temporaryInfo.unresolvedEntryStatus;
      }
    }
    if (!ignoreUnresolvedEntry && unresolvedEntryStatus != null && !unresolvedEntryStatus.isOK())
      throw new JavaModelException(unresolvedEntryStatus);
    return resolvedClasspath;
  }
View Full Code Here

    // actual file saving
    try {
      setSharedProperty(JavaProject.CLASSPATH_FILENAME, encodeClasspath(newClasspath, referencedEntries, newOutputLocation, true, unknownElements));
      return true;
    } catch (CoreException e) {
      throw new JavaModelException(e);
    }
  }
View Full Code Here

  super(parentElement, source, force);
}
protected ASTNode generateElementAST(ASTRewrite rewriter, ICompilationUnit cu) throws JavaModelException {
  ASTNode node = super.generateElementAST(rewriter, cu);
  if (node.getNodeType() != ASTNode.FIELD_DECLARATION)
    throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_CONTENTS));
  return node;
}
View Full Code Here

}
/**
* @see org.eclipse.jdt.core.IPackageFragment
*/
public ICompilationUnit createCompilationUnit(String cuName, String contents, boolean force, IProgressMonitor monitor) throws JavaModelException {
  throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.READ_ONLY, this));
}
View Full Code Here

  super(parentElement, source, false);
}
protected ASTNode generateElementAST(ASTRewrite rewriter, ICompilationUnit cu) throws JavaModelException {
  ASTNode node = super.generateElementAST(rewriter, cu);
  if (node.getNodeType() != ASTNode.INITIALIZER)
    throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_CONTENTS));
  return node;
}
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.