Class TranslatorException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- net.ssehub.easy.dslCore.translation.TranslatorException
-
- All Implemented Interfaces:
java.io.Serializable,IIdentifiable
- Direct Known Subclasses:
UnknownTypeException,UnknownVariableException
public class TranslatorException extends java.lang.Exception implements IIdentifiable
Defines a specific model translator exception which carries information about the context where the error occurred.- Author:
- Holger Eichelberger
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.emf.ecore.EObjectcauseprivate org.eclipse.emf.ecore.EStructuralFeaturecausingFeatureprivate intcodestatic intCONSUMEstatic intINTERNAL
-
Constructor Summary
Constructors Constructor Description TranslatorException(java.lang.String message, org.eclipse.emf.ecore.EObject cause, org.eclipse.emf.ecore.EStructuralFeature causingFeature, int code)Creates a translator exception upon a given message string.TranslatorException(IIdentifiable ex, org.eclipse.emf.ecore.EObject cause, org.eclipse.emf.ecore.EStructuralFeature causingFeature)Creates a translator exception upon an IVML exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanconsume()Returns whether this exception shall be consumed and not passed to the user.org.eclipse.emf.ecore.EStructuralFeaturegetCausingFeature()Returns the the specific language feature withingetECause()which caused the exception.intgetCode()Returns a numerical code representing the problem.org.eclipse.emf.ecore.EObjectgetECause()Returns the Ecore language model element for which the exception was caused.intgetId()Returns a numerical identifier representing the actualmessage.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.ssehub.easy.basics.messages.IIdentifiable
getMessage
-
-
-
-
Field Detail
-
CONSUME
public static final int CONSUME
- See Also:
- Constant Field Values
-
INTERNAL
public static final int INTERNAL
- See Also:
- Constant Field Values
-
cause
private org.eclipse.emf.ecore.EObject cause
-
causingFeature
private org.eclipse.emf.ecore.EStructuralFeature causingFeature
-
code
private int code
-
-
Constructor Detail
-
TranslatorException
public TranslatorException(IIdentifiable ex, org.eclipse.emf.ecore.EObject cause, org.eclipse.emf.ecore.EStructuralFeature causingFeature)
Creates a translator exception upon an IVML exception.- Parameters:
ex- the causing exceptioncause- the Ecore language model element for which the exception was causedcausingFeature- the specific language feature withincausewhich caused the exception
-
TranslatorException
public TranslatorException(java.lang.String message, org.eclipse.emf.ecore.EObject cause, org.eclipse.emf.ecore.EStructuralFeature causingFeature, int code)Creates a translator exception upon a given message string.- Parameters:
message- the message stringcause- the Ecore language model element for which the exception was causedcausingFeature- the specific language feature withincausewhich caused the exceptioncode- a numerical code representing the problem
-
-
Method Detail
-
getECause
public org.eclipse.emf.ecore.EObject getECause()
Returns the Ecore language model element for which the exception was caused.- Returns:
- the Ecore language model
-
getCausingFeature
public org.eclipse.emf.ecore.EStructuralFeature getCausingFeature()
Returns the the specific language feature withingetECause()which caused the exception.- Returns:
- the language feature
-
getCode
public int getCode()
Returns a numerical code representing the problem.- Returns:
- a numerical code
-
getId
public int getId()
Description copied from interface:IIdentifiableReturns a numerical identifier representing the actualmessage. This identifier is used for asserting exceptions in tests.- Specified by:
getIdin interfaceIIdentifiable- Returns:
- the identifier
-
consume
public boolean consume()
Returns whether this exception shall be consumed and not passed to the user.- Returns:
trueif it shall be consumed,falseelse
-
-