Package ghidra.program.model.lang
Class LanguageVersionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
ghidra.util.exception.UsrException
ghidra.util.exception.VersionException
ghidra.program.model.lang.LanguageVersionException
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields inherited from class ghidra.util.exception.VersionException
NEWER_VERSION, OLDER_VERSION, UNKNOWN_VERSION
-
Constructor Summary
ConstructorDescriptionLanguageVersionException
(Language oldLanguage, LanguageTranslator languageTranslator) Construct a major upgradeable language version exceptionLanguageVersionException
(String msg, boolean upgradable) Construct a language version exception -
Method Summary
Modifier and TypeMethodDescriptionstatic LanguageVersionException
Check language against required version information.static LanguageVersionException
checkForLanguageChange
(LanguageNotFoundException e, LanguageID languageID, int languageVersion) Determine if a missing language resulting in aLanguageNotFoundException
can be upgraded to a replacement language via a language translation.Old language upgrade translator if language translation requiredOld language stub if language translation requiredMethods inherited from class ghidra.util.exception.VersionException
combine, getDetailMessage, getVersionIndicator, isUpgradable, setDetailMessage
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
LanguageVersionException
Construct a language version exception- Parameters:
msg
- condition detailupgradable
- true indicates that an upgrade is possible.
-
LanguageVersionException
Construct a major upgradeable language version exception- Parameters:
oldLanguage
- old language stublanguageTranslator
- language transalator
-
-
Method Details
-
getOldLanguage
Old language stub if language translation required- Returns:
- Old language stub or null
-
getLanguageTranslator
Old language upgrade translator if language translation required- Returns:
- language upgrade translator or null
-
check
public static LanguageVersionException check(Language language, int languageVersion, int languageMinorVersion) throws LanguageNotFoundException Check language against required version information. If not a match or upgradeable aLanguageNotFoundException
will be thrown. If an upgradeableLanguageVersionException
is returned, a major version change will also include the appropriate Old-Language stub andLanguageTranslator
required to facilitate a language upgrade.- Parameters:
language
- language corresponding to desired language IDlanguageVersion
- required major language versionlanguageMinorVersion
- required minor language version. A negative minor version will be ignored.- Returns:
- null if language matches, otherwise an upgradeable
LanguageVersionException
. - Throws:
LanguageNotFoundException
- if language is a mismatch and is not upgradeable.
-
checkForLanguageChange
public static LanguageVersionException checkForLanguageChange(LanguageNotFoundException e, LanguageID languageID, int languageVersion) throws LanguageNotFoundException Determine if a missing language resulting in aLanguageNotFoundException
can be upgraded to a replacement language via a language translation.- Parameters:
e
- originalLanguageNotFoundException
languageID
- language ID of original language requestedlanguageVersion
- original language major version- Returns:
- upgradeable
LanguageVersionException
- Throws:
LanguageNotFoundException
- original exception if a language transaltion is not available
-