|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.eclipse.core.runtime.CoreException
org.eclipse.jdt.core.JavaModelException
public class JavaModelException
A checked exception representing a failure in the Java model. Java model exceptions contain a Java-specific status object describing the cause of the exception.
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
,
Serialized FormConstructor Summary | |
---|---|
JavaModelException(org.eclipse.core.runtime.CoreException exception)
Creates a Java model exception for the given CoreException . |
|
JavaModelException(IJavaModelStatus status)
Creates a Java model exception for the given Java-specific status object. |
|
JavaModelException(java.lang.Throwable e,
int code)
Creates a Java model exception that wrappers the given Throwable . |
Method Summary | |
---|---|
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()
|
Methods inherited from class org.eclipse.core.runtime.CoreException |
---|
getCause, getStatus, printStackTrace |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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 Throwable
code
- one of the Java-specific status codes declared in
IJavaModelStatusConstants
IJavaModelStatusConstants
,
IStatus.ERROR
public JavaModelException(org.eclipse.core.runtime.CoreException exception)
CoreException
.
Equivalent to
JavaModelException(exception,IJavaModelStatusConstants.CORE_EXCEPTION
.
exception
- the CoreException
public JavaModelException(IJavaModelStatus status)
status
- the Java-specific status objectMethod Detail |
---|
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_CLASSPATH
public void printStackTrace(java.io.PrintStream output)
printStackTrace
in class org.eclipse.core.runtime.CoreException
output
- the print streampublic void printStackTrace(java.io.PrintWriter output)
printStackTrace
in class org.eclipse.core.runtime.CoreException
output
- the print writerpublic java.lang.String toString()
toString
in class java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |