- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.tentackle.model.ModelException
-
- All Implemented Interfaces:
java.io.Serializable
public class ModelException extends java.lang.ExceptionModel 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 ModelElementgetElement()Gets the related model element.booleanisRelatedTo(ModelElement otherElement)Returns whether given element is related to this exception.
-
-
-
Constructor Detail
-
ModelException
public ModelException(java.lang.String message, ModelElement element, java.lang.Throwable cause)Creates a model exception.- Parameters:
message- the error messageelement- the related model elementcause- the cause
-
ModelException
public ModelException(java.lang.String message, ModelElement element)Creates a model exception.- Parameters:
message- the error messageelement- the related model element
-
ModelException
public ModelException(java.lang.String message, java.lang.Throwable cause)Creates a model exception.- Parameters:
message- the error messagecause- 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
-
-