|
TPTP 4.6.0 Platform Project Public API Specification |
||||||||
| 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.tptp.platform.probekit.util.InvalidProbeBundleException
public class InvalidProbeBundleException
This exception encapsulates a number of things that might be wrong with a a collection of files/resources that represent a probe. Though this class was created primarily for use with ProbeFileBundle and ProbeResourceBundle, it may be useful elsewhere, such as by the registry.
The exception can hold one or many reasons for a bundle to be considered invalid - reason is a bit mask, not a single code. Additional bits of information may also be added, such as which file/resource is inaccessible. Callers should be prepared, however, for this extra info to be missing.
Unfortunately, since this exception does double duty for both File and IResource problems, pulling off the extra details can be tricky. You can always get it as an Object or a File, but not always as a resource (all Resources are Files, but not all Files are Resources).
To mitigate this problem somewhat, getFileOrResourceName() can be used to retrieve the most commonly interesting detail.
| Field Summary | |
|---|---|
static int |
INACCESSIBLE_FILE
|
static int |
INACCESSIBLE_MODEL_FILE
|
static int |
INACCESSIBLE_SCRIPT_FILE
|
static int |
INACCESSIBLE_SUPPORT_FILE
|
static int |
INVALID_MODEL
|
static int |
MISSING_FILE
|
static int |
MISSING_MODEL_FILE
|
static int |
MISSING_SCRIPT_FILE
|
static int |
MISSING_SUPPORT_FILE
|
static int |
MODEL_FILE_ERR
|
static int |
SCRIPT_FILE_ERR
|
static int |
SUPPORT_FILE_ERR
|
static int |
TOO_MANY_FILES_WITH_EXT
|
| Constructor Summary | |
|---|---|
InvalidProbeBundleException(int reason)
|
|
InvalidProbeBundleException(int reason,
java.lang.Object o)
|
|
InvalidProbeBundleException(int reason,
java.lang.Object o,
java.lang.String extension)
|
|
InvalidProbeBundleException(int reason,
java.lang.String extension)
|
|
InvalidProbeBundleException(int reason,
java.lang.Throwable e)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getExtension()
If reason includes TOO_MANY_FILES_WITH_EXT, calling this method should reveal which type of file we found too many of. |
java.io.File |
getFileDetail()
Retrieve exception detail as a File. |
java.lang.String |
getFileOrResourceName()
Get the simple name of the file/resource detail, if available. |
java.lang.Object |
getObjectDetail()
Retrieve exception detail as an Object. |
int |
getReason()
The reasons behind this exception. |
org.eclipse.core.resources.IResource |
getResourceDetail()
Retrieve exception detail as an IResource. |
boolean |
hasFileDetail()
Determine whether or not there is File exception detail available. |
boolean |
hasResourceDetail()
Determine whether or not there is IResource exception detail available. |
boolean |
testReason(int mask)
Test to see whether or not mask is one of the causes of this exception. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MISSING_FILE
public static final int INACCESSIBLE_FILE
public static final int TOO_MANY_FILES_WITH_EXT
public static final int INVALID_MODEL
public static final int MODEL_FILE_ERR
public static final int SCRIPT_FILE_ERR
public static final int SUPPORT_FILE_ERR
public static final int MISSING_MODEL_FILE
public static final int MISSING_SCRIPT_FILE
public static final int MISSING_SUPPORT_FILE
public static final int INACCESSIBLE_MODEL_FILE
public static final int INACCESSIBLE_SCRIPT_FILE
public static final int INACCESSIBLE_SUPPORT_FILE
| Constructor Detail |
|---|
public InvalidProbeBundleException(int reason)
public InvalidProbeBundleException(int reason,
java.lang.Throwable e)
public InvalidProbeBundleException(int reason,
java.lang.String extension)
public InvalidProbeBundleException(int reason,
java.lang.Object o)
public InvalidProbeBundleException(int reason,
java.lang.Object o,
java.lang.String extension)
| Method Detail |
|---|
public int getReason()
public java.lang.String getExtension()
public java.lang.Object getObjectDetail()
public java.io.File getFileDetail()
public org.eclipse.core.resources.IResource getResourceDetail()
public boolean hasFileDetail()
public boolean hasResourceDetail()
public java.lang.String getFileOrResourceName()
public boolean testReason(int mask)
mask - One of the constants declared by this class
|
TPTP 4.6.0 Platform Project Public API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||