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
,
Serialized FormConstructor and Description |
---|
JavaModelException(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(IStatus status)
Creates a Java model exception for the given status object.
|
JavaModelException(Throwable e,
int code)
Creates a Java model exception that wrappers the given
Throwable . |
Modifier and Type | Method and Description |
---|---|
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(PrintStream output)
Prints this exception's stack trace to the given print stream.
|
void |
printStackTrace(PrintWriter output)
Prints this exception's stack trace to the given print writer.
|
String |
toString() |
getCause, getStatus, printStackTrace
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace
public JavaModelException(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(CoreException exception)
CoreException
.
Equivalent to
JavaModelException(exception,IJavaModelStatusConstants.CORE_EXCEPTION
.exception
- the CoreException
public JavaModelException(IJavaModelStatus status)
status
- the Java-specific status objectpublic JavaModelException(IStatus status)
public 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(PrintStream output)
printStackTrace
in class CoreException
output
- the print streampublic void printStackTrace(PrintWriter output)
printStackTrace
in class CoreException
output
- the print writer
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.