Class VilException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- net.ssehub.easy.basics.messages.AbstractException
-
- net.ssehub.easy.instantiation.core.model.common.VilException
-
- All Implemented Interfaces:
java.io.Serializable,IIdentifiable
public class VilException extends AbstractException
Defines a specific exception issued when building up the model fails for some reason.- Author:
- Holger Eichelberger
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private VilException[]additionalCausesOptional additional causes.static intID_ALREADY_REGISTEREDIn case that an artifact type is already registered.static intID_ARTIFACT_INTERNALDefines an identifier if something (unspecified) is wrong in an artifact, e.g., its syntax or semantic.static intID_CANNOT_INSTANTIATEDefines an identifier if a type cannot be instantiated.static intID_CANNOT_RESOLVE_JAVA_EXTENSIONDefines an identifier if a Java extension class cannot be resolved.static intID_EXECUTION_ERRORIn case that an operation execution fails.static intID_INSUFFICIENT_ARGUMENTUse of an insufficient argument.static intID_INVALIDUse of an invalid (deleted) object.static intID_INVALID_CHARACTERUse of an invalid character.static intID_INVALID_DATAIn case that relevant data is invalid.static intID_INVALID_INSTANTIATORIn case that the class structure of an instantiator is invalid.static intID_INVALID_ITERATORUse of an invalid iterator combination.static intID_INVALID_PATTERNUse of an invalid pattern.static intID_INVALID_TYPEUse of an invalid type.static intID_INVALID_VERSIONDefines an identifier if a version string is illegally formatted.static intID_IODefines an identifier if something with I/O goes wrong.static intID_IS_CONSTANTDefines an identifier if something is constant.static intID_IS_NULLAn unexpected null value.static intID_MISSING_DATAIn case that relevant data is missing.static intID_NO_ARTIFACT_CREATORNo artifact creator is registered to handle a real (underlying) artifact.static intID_NO_RESULTIn case that an operation returns no result.static intID_NOT_FOUNDDefines an identifier if something cannot be found.static intID_NOT_VISIBLEIf an element is not visible.static intID_NULL_VALUEDefines an identifier if a null value occurs at runtime.static intID_OP_NOT_FOUNDIn case that registering an artifact operation was not found.static intID_PATTERNSome kind of (matching) pattern syntax problem.static intID_RUNTIMEDefines an identifier if something does not work properly during runtime.static intID_RUNTIME_CYCLEDefines an identifier if something goes into cycles while runtime.static intID_RUNTIME_EXECUTIONDefines an identifier if something during runtime execution for creating an artifact or a set of artifacts fails.static intID_RUNTIME_ITERATORDefines an identifier if something about an iterator does not work properly during runtime.static intID_RUNTIME_NOT_RESOLVEDDefines an identifier if something is wrong with a resolvable element, such as a missing import (whyever).static intID_RUNTIME_PARAMETERDefines an identifier if something is wrong with the runtime parameter.static intID_RUNTIME_READ_WRITEDefines an identifier if access to a field fails due to read/write restrictions.static intID_RUNTIME_RESOURCEDefines an identifier if something during runtime execution for creating an artifact or a set of artifacts fails.static intID_RUNTIME_RULE_FAILEDDefines an identifier if rules failed at runtime.static intID_RUNTIME_STARTRULEDefines an identifier if something is wrong with the start rule.static intID_RUNTIME_TYPEDefines an identifier if something is wrong a value to type assignment at runtime.static intID_SECURITYSome kind of security / access problem.static intID_SECURITY_ERRORIn case that an operation execution fails due to security reasons.static intID_STATICIn case that a static access cannot be handled.static intID_SYSTEM_EXECDefines an identifier if something does not work properly during a system execution call.static intID_TYPE_INCOMPATIBILITYIn case that registering an artifact type fails due to incompatibilities with existing types.static intID_UNKNOWNThe actual kind of problem is not known (may only appear in case of multiple but empty causes).static intID_WHILE_INSTANTIATIONHappened during instantiation.private static longserialVersionUIDFor serialization.-
Fields inherited from class net.ssehub.easy.basics.messages.AbstractException
ID_AMBIGUOUS, ID_CANNOT_RESOLVE, ID_INTERNAL, ID_SEMANTIC, ID_WARNING
-
-
Constructor Summary
Constructors Constructor Description VilException(java.lang.String message, int id)Creates a buildlang exception based on a givenmessage.VilException(java.lang.String message, java.lang.Throwable cause, int id)Creates a buildlang exception from a message and an optional cause.VilException(java.lang.Throwable throwable, int id)Creates an exception from a throwable.VilException(java.util.List<VilException> causes)Creates a new exception.VilException(AbstractException cause)Creates an exception from a known exception as cause.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static VilExceptiongetFirstCause(java.util.List<VilException> causes)Returns the first cause in case of multiplecauses.private static intgetFirstId(java.util.List<VilException> causes)Returns the first cause in case of multiplecauses.private static java.lang.StringgetFirstMessage(java.util.List<VilException> causes)Returns the first message in case of multiplecauses.voidprintStackTrace(java.io.PrintStream stream)-
Methods inherited from class net.ssehub.easy.basics.messages.AbstractException
getId
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, 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
-
ID_NOT_FOUND
public static final int ID_NOT_FOUND
Defines an identifier if something cannot be found.- See Also:
- Constant Field Values
-
ID_IO
public static final int ID_IO
Defines an identifier if something with I/O goes wrong.- See Also:
- Constant Field Values
-
ID_IS_CONSTANT
public static final int ID_IS_CONSTANT
Defines an identifier if something is constant.- See Also:
- Constant Field Values
-
ID_RUNTIME_STARTRULE
public static final int ID_RUNTIME_STARTRULE
Defines an identifier if something is wrong with the start rule.- See Also:
- Constant Field Values
-
ID_RUNTIME_PARAMETER
public static final int ID_RUNTIME_PARAMETER
Defines an identifier if something is wrong with the runtime parameter.- See Also:
- Constant Field Values
-
ID_CANNOT_RESOLVE_JAVA_EXTENSION
public static final int ID_CANNOT_RESOLVE_JAVA_EXTENSION
Defines an identifier if a Java extension class cannot be resolved.- See Also:
- Constant Field Values
-
ID_RUNTIME_CYCLE
public static final int ID_RUNTIME_CYCLE
Defines an identifier if something goes into cycles while runtime.- See Also:
- Constant Field Values
-
ID_RUNTIME_RULE_FAILED
public static final int ID_RUNTIME_RULE_FAILED
Defines an identifier if rules failed at runtime.- See Also:
- Constant Field Values
-
ID_RUNTIME_TYPE
public static final int ID_RUNTIME_TYPE
Defines an identifier if something is wrong a value to type assignment at runtime.- See Also:
- Constant Field Values
-
ID_RUNTIME_NOT_RESOLVED
public static final int ID_RUNTIME_NOT_RESOLVED
Defines an identifier if something is wrong with a resolvable element, such as a missing import (whyever).- See Also:
- Constant Field Values
-
ID_SYSTEM_EXEC
public static final int ID_SYSTEM_EXEC
Defines an identifier if something does not work properly during a system execution call.- See Also:
- Constant Field Values
-
ID_RUNTIME
public static final int ID_RUNTIME
Defines an identifier if something does not work properly during runtime.- See Also:
- Constant Field Values
-
ID_CANNOT_INSTANTIATE
public static final int ID_CANNOT_INSTANTIATE
Defines an identifier if a type cannot be instantiated.- See Also:
- Constant Field Values
-
ID_NULL_VALUE
public static final int ID_NULL_VALUE
Defines an identifier if a null value occurs at runtime.- See Also:
- Constant Field Values
-
ID_ALREADY_REGISTERED
public static final int ID_ALREADY_REGISTERED
In case that an artifact type is already registered.- See Also:
- Constant Field Values
-
ID_TYPE_INCOMPATIBILITY
public static final int ID_TYPE_INCOMPATIBILITY
In case that registering an artifact type fails due to incompatibilities with existing types.- See Also:
- Constant Field Values
-
ID_OP_NOT_FOUND
public static final int ID_OP_NOT_FOUND
In case that registering an artifact operation was not found.- See Also:
- Constant Field Values
-
ID_NO_RESULT
public static final int ID_NO_RESULT
In case that an operation returns no result.- See Also:
- Constant Field Values
-
ID_EXECUTION_ERROR
public static final int ID_EXECUTION_ERROR
In case that an operation execution fails.- See Also:
- Constant Field Values
-
ID_SECURITY_ERROR
public static final int ID_SECURITY_ERROR
In case that an operation execution fails due to security reasons.- See Also:
- Constant Field Values
-
ID_MISSING_DATA
public static final int ID_MISSING_DATA
In case that relevant data is missing.- See Also:
- Constant Field Values
-
ID_INVALID_DATA
public static final int ID_INVALID_DATA
In case that relevant data is invalid.- See Also:
- Constant Field Values
-
ID_INVALID_INSTANTIATOR
public static final int ID_INVALID_INSTANTIATOR
In case that the class structure of an instantiator is invalid.- See Also:
- Constant Field Values
-
ID_STATIC
public static final int ID_STATIC
In case that a static access cannot be handled.- See Also:
- Constant Field Values
-
ID_UNKNOWN
public static final int ID_UNKNOWN
The actual kind of problem is not known (may only appear in case of multiple but empty causes).- See Also:
- Constant Field Values
-
ID_SECURITY
public static final int ID_SECURITY
Some kind of security / access problem.- See Also:
- Constant Field Values
-
ID_PATTERN
public static final int ID_PATTERN
Some kind of (matching) pattern syntax problem.- See Also:
- Constant Field Values
-
ID_INVALID
public static final int ID_INVALID
Use of an invalid (deleted) object.- See Also:
- Constant Field Values
-
ID_NO_ARTIFACT_CREATOR
public static final int ID_NO_ARTIFACT_CREATOR
No artifact creator is registered to handle a real (underlying) artifact.- See Also:
- Constant Field Values
-
ID_IS_NULL
public static final int ID_IS_NULL
An unexpected null value.- See Also:
- Constant Field Values
-
ID_INVALID_TYPE
public static final int ID_INVALID_TYPE
Use of an invalid type.- See Also:
- Constant Field Values
-
ID_INVALID_CHARACTER
public static final int ID_INVALID_CHARACTER
Use of an invalid character.- See Also:
- Constant Field Values
-
ID_INSUFFICIENT_ARGUMENT
public static final int ID_INSUFFICIENT_ARGUMENT
Use of an insufficient argument.- See Also:
- Constant Field Values
-
ID_INVALID_PATTERN
public static final int ID_INVALID_PATTERN
Use of an invalid pattern.- See Also:
- Constant Field Values
-
ID_WHILE_INSTANTIATION
public static final int ID_WHILE_INSTANTIATION
Happened during instantiation.- See Also:
- Constant Field Values
-
ID_RUNTIME_ITERATOR
public static final int ID_RUNTIME_ITERATOR
Defines an identifier if something about an iterator does not work properly during runtime.- See Also:
- Constant Field Values
-
ID_RUNTIME_EXECUTION
public static final int ID_RUNTIME_EXECUTION
Defines an identifier if something during runtime execution for creating an artifact or a set of artifacts fails.- See Also:
- Constant Field Values
-
ID_RUNTIME_RESOURCE
public static final int ID_RUNTIME_RESOURCE
Defines an identifier if something during runtime execution for creating an artifact or a set of artifacts fails.- See Also:
- Constant Field Values
-
ID_INVALID_VERSION
public static final int ID_INVALID_VERSION
Defines an identifier if a version string is illegally formatted.- See Also:
- Constant Field Values
-
ID_ARTIFACT_INTERNAL
public static final int ID_ARTIFACT_INTERNAL
Defines an identifier if something (unspecified) is wrong in an artifact, e.g., its syntax or semantic.- See Also:
- Constant Field Values
-
ID_RUNTIME_READ_WRITE
public static final int ID_RUNTIME_READ_WRITE
Defines an identifier if access to a field fails due to read/write restrictions.- See Also:
- Constant Field Values
-
ID_INVALID_ITERATOR
public static final int ID_INVALID_ITERATOR
Use of an invalid iterator combination.- See Also:
- Constant Field Values
-
ID_NOT_VISIBLE
public static final int ID_NOT_VISIBLE
If an element is not visible.- See Also:
- Constant Field Values
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
additionalCauses
private VilException[] additionalCauses
Optional additional causes.
-
-
Constructor Detail
-
VilException
public VilException(java.lang.String message, int id)Creates a buildlang exception based on a givenmessage.- Parameters:
message- the message of the exceptionid- the identifier (see constants above)
-
VilException
public VilException(java.lang.String message, java.lang.Throwable cause, int id)Creates a buildlang exception from a message and an optional cause.- Parameters:
message- the message of the exceptioncause- the originally causing exceptionid- the identifier (see constants above)
-
VilException
public VilException(AbstractException cause)
Creates an exception from a known exception as cause. Note that the identification fromcauseis taken over as identification.- Parameters:
cause- the causing exception
-
VilException
public VilException(java.lang.Throwable throwable, int id)Creates an exception from a throwable.- Parameters:
throwable- the throwable representing cause and messageid- the identifier (see constants above)
-
VilException
public VilException(java.util.List<VilException> causes)
Creates a new exception.- Parameters:
causes- the multiple causes causing this exception
-
-
Method Detail
-
getFirstMessage
private static java.lang.String getFirstMessage(java.util.List<VilException> causes)
Returns the first message in case of multiplecauses.- Parameters:
causes- the causes- Returns:
- the first message or an empty string
-
getFirstCause
private static VilException getFirstCause(java.util.List<VilException> causes)
Returns the first cause in case of multiplecauses.- Parameters:
causes- the causes- Returns:
- the first cause or null
-
getFirstId
private static int getFirstId(java.util.List<VilException> causes)
Returns the first cause in case of multiplecauses.- Parameters:
causes- the causes- Returns:
- the first cause or
ID_UNKNOWN
-
printStackTrace
public void printStackTrace(java.io.PrintStream stream)
- Overrides:
printStackTracein classjava.lang.Throwable
-
-