public class JavaModelException
extends CoreException
Instances of this class are automatically created by the Java model when problems arise, so there is generally no need for clients to create instances.
IJavaModelStatus,
IJavaModelStatusConstants| Constructor and Description |
|---|
JavaModelException(CoreException exception)
Creates a Java model exception for the given
CoreException. |
JavaModelException(IStatus status)
Creates a Java model exception for the given status object.
|
JavaModelException(java.lang.Throwable e,
int code)
Creates a Java model exception that wrappers the given
Throwable. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Throwable |
getException()
Returns the underlying
Throwable that caused the failure. |
IJavaModelStatus |
getJavaModelStatus()
Returns the Java model status object for this exception.
|
boolean |
isDoesNotExist()
Returns whether this exception indicates that a Java model element does not
exist.
|
void |
printStackTrace(java.io.PrintStream output)
Prints this exception's stack trace to the given print stream.
|
void |
printStackTrace(java.io.PrintWriter output)
Prints this exception's stack trace to the given print writer.
|
java.lang.String |
toString() |
public JavaModelException(java.lang.Throwable e,
int code)
Throwable.
The exception contains a Java-specific status object with severity
IStatus.ERROR and the given status code.e - the Throwablecode - one of the Java-specific status codes declared in
IJavaModelStatusConstantsIJavaModelStatusConstants,
org.eclipse.core.runtime.IStatus#ERRORpublic JavaModelException(CoreException exception)
CoreException.
Equivalent to
JavaModelException(exception,IJavaModelStatusConstants.CORE_EXCEPTION.exception - the CoreExceptionpublic JavaModelException(IStatus status)
public java.lang.Throwable getException()
Throwable that caused the failure.Throwable, or null if the
direct case of the failure was at the Java model layerpublic IJavaModelStatus getJavaModelStatus()
(IJavaModelStatus) getStatus().public boolean isDoesNotExist()
IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST or
IJavaModelStatusConstants.ELEMENT_NOT_ON_CLASSPATH.
This is a convenience method.true if this exception indicates that a Java model
element does not existIJavaModelStatus.isDoesNotExist(),
IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST,
IJavaModelStatusConstants.ELEMENT_NOT_ON_CLASSPATHpublic void printStackTrace(java.io.PrintStream output)
output - the print streampublic void printStackTrace(java.io.PrintWriter output)
output - the print writerpublic java.lang.String toString()