Class TranslatorException

java.lang.Object
java.lang.Throwable
java.lang.Exception
net.ssehub.easy.dslCore.translation.TranslatorException
All Implemented Interfaces:
Serializable, net.ssehub.easy.basics.messages.IIdentifiable

public class TranslatorException extends Exception implements net.ssehub.easy.basics.messages.IIdentifiable
Defines a specific model translator exception which carries information about the context where the error occurred.
Author:
Holger Eichelberger
See Also:
  • Field Details

    • CONSUME

      public static final int CONSUME
      See Also:
    • INTERNAL

      public static final int INTERNAL
      See Also:
    • cause

      private org.eclipse.emf.ecore.EObject cause
    • causingFeature

      private org.eclipse.emf.ecore.EStructuralFeature causingFeature
    • code

      private int code
  • Constructor Details

    • TranslatorException

      public TranslatorException(net.ssehub.easy.basics.messages.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 exception
      cause - the Ecore language model element for which the exception was caused
      causingFeature - the specific language feature within cause which caused the exception
    • TranslatorException

      public TranslatorException(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 string
      cause - the Ecore language model element for which the exception was caused
      causingFeature - the specific language feature within cause which caused the exception
      code - a numerical code representing the problem
  • Method Details

    • 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 within getECause() 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()
      Specified by:
      getId in interface net.ssehub.easy.basics.messages.IIdentifiable
    • consume

      public boolean consume()
      Returns whether this exception shall be consumed and not passed to the user.
      Returns:
      true if it shall be consumed, false else