Class ModelException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ModelException
    extends java.lang.Exception
    Model parsing exception.
    Author:
    harald
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ModelException​(java.lang.String message)
      Creates a model exception.
      ModelException​(java.lang.String message, java.lang.Throwable cause)
      Creates a model exception.
      ModelException​(java.lang.String message, ModelElement element)
      Creates a model exception.
      ModelException​(java.lang.String message, ModelElement element, java.lang.Throwable cause)
      Creates a model exception.
      ModelException​(java.util.Collection<ModelError> errors)
      Creates a model exception from a collection of errors.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ModelElement getElement()
      Gets the related model element.
      boolean isRelatedTo​(ModelElement otherElement)
      Returns whether given element is related to this exception.
      • 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
    • Constructor Detail

      • ModelException

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

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

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

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

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

      • getElement

        public ModelElement getElement()
        Gets the related model element.
        Returns:
        the element, may be null!
      • 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