Package ghidra.util.exception
Class VersionException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- ghidra.util.exception.UsrException
-
- ghidra.util.exception.VersionException
-
- All Implemented Interfaces:
java.io.Serializable
public class VersionException extends UsrException
Exception thrown when an object's version does not match its expected version.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
NEWER_VERSION
Object created with newer software version.static int
OLDER_VERSION
Object created with older software version.static int
UNKNOWN_VERSION
Object created with unknown software version.
-
Constructor Summary
Constructors Constructor Description VersionException()
Constructor - not upgradeableVersionException(boolean upgradable)
Constructor.VersionException(int versionIndicator, boolean upgradable)
Constructor.VersionException(java.lang.String msg)
Constructor - not upgradeableVersionException(java.lang.String msg, int versionIndicator, boolean upgradable)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VersionException
combine(VersionException ve)
Combine another VersionException with this one.java.lang.String
getDetailMessage()
int
getVersionIndicator()
Return a version indicator (OLDER_VERSION, NEWER_VERSION or UNKNOWN_VERSION).boolean
isUpgradable()
Return true if the file can be upgraded to the current version.void
setDetailMessage(java.lang.String message)
-
-
-
Field Detail
-
UNKNOWN_VERSION
public static final int UNKNOWN_VERSION
Object created with unknown software version.- See Also:
- Constant Field Values
-
OLDER_VERSION
public static final int OLDER_VERSION
Object created with older software version.- See Also:
- Constant Field Values
-
NEWER_VERSION
public static final int NEWER_VERSION
Object created with newer software version.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VersionException
public VersionException()
Constructor - not upgradeable
-
VersionException
public VersionException(java.lang.String msg)
Constructor - not upgradeable- Parameters:
msg
- detailed message
-
VersionException
public VersionException(boolean upgradable)
Constructor.- Parameters:
upgradable
- true indicates that an upgrade is possible. If true the version indicator value is set to OLDER_VERSION, if false it is set to UNKNOWN_VERSION.
-
VersionException
public VersionException(int versionIndicator, boolean upgradable)
Constructor.- Parameters:
versionIndicator
- OLDER_VERSION, NEWER_VERSION or UNKNOWN_VERSIONupgradable
- true indicates that an upgrade is possible.
-
VersionException
public VersionException(java.lang.String msg, int versionIndicator, boolean upgradable)
Constructor.- Parameters:
msg
- detailed messageversionIndicator
- OLDER_VERSION, NEWER_VERSION or UNKNOWN_VERSIONupgradable
- true indicates that an upgrade is possible.
-
-
Method Detail
-
isUpgradable
public boolean isUpgradable()
Return true if the file can be upgraded to the current version.
-
getVersionIndicator
public int getVersionIndicator()
Return a version indicator (OLDER_VERSION, NEWER_VERSION or UNKNOWN_VERSION). Only an OLDER_VERSION has the possibility of being upgradeable.
-
combine
public VersionException combine(VersionException ve)
Combine another VersionException with this one.- Parameters:
ve
- another version exception- Returns:
- this combined version exception
-
setDetailMessage
public void setDetailMessage(java.lang.String message)
-
getDetailMessage
public java.lang.String getDetailMessage()
-
-