Class ModelException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.tentackle.model.ModelException
All Implemented Interfaces:
Serializable

public class ModelException extends Exception
Model parsing exception.
Author:
harald
See Also:
  • Field Details

  • Constructor Details

    • ModelException

      public ModelException(String message, ModelElement element, Throwable cause)
      Creates a model exception.
      Parameters:
      message - the error message
      element - the related model element
      cause - the cause
    • ModelException

      public ModelException(String message, ModelElement element)
      Creates a model exception.
      Parameters:
      message - the error message
      element - the related model element
    • ModelException

      public ModelException(String message, Throwable cause)
      Creates a model exception.
      Parameters:
      message - the error message
      cause - the cause
    • ModelException

      public ModelException(String message)
      Creates a model exception.
      Parameters:
      message - the error message
    • ModelException

      public ModelException(Collection<ModelError> errors)
      Creates a model exception from a collection of errors.
      Parameters:
      errors - the errors
  • Method Details

    • getElement

      public ModelElement getElement()
      Gets the related model element.
      Returns:
      the element, may be null!
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • isRelatedTo

      public boolean isRelatedTo(ModelElement otherElement)
      Returns whether given element is related to this exception.
      Parameters:
      otherElement - some other model element
      Returns:
      true if related