java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.helidon.codegen.CodegenException
- All Implemented Interfaces:
Serializable
An exception for any code processing and generation tools.
This exception can hold
originatingElement()
that may be used to provide more information to the user.- See Also:
-
Constructor Summary
ConstructorDescriptionCodegenException
(String message) Constructor with a message.CodegenException
(String message, Object originatingElement) Constructor with a message and an originating element.CodegenException
(String message, Throwable cause) Constructor with a message and a cause.CodegenException
(String message, Throwable cause, Object originatingElement) Constructor with a message, cause, and an originating element. -
Method Summary
Modifier and TypeMethodDescriptionOriginating element.toEvent
(System.Logger.Level level) Create a codegen event to log withCodegenLogger.log(CodegenEvent)
.toEvent
(System.Logger.Level level, String message) Create a codegen event to log withCodegenLogger.log(CodegenEvent)
.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CodegenException
Constructor with a message.- Parameters:
message
- descriptive message
-
CodegenException
Constructor with a message and a cause.- Parameters:
message
- descriptive messagecause
- throwable triggering this exception
-
CodegenException
Constructor with a message and an originating element.- Parameters:
message
- descriptive messageoriginatingElement
- element that caused this exception
-
CodegenException
Constructor with a message, cause, and an originating element.- Parameters:
message
- descriptive messagecause
- throwable triggering this exceptionoriginatingElement
- element that caused this exception
-
-
Method Details
-
originatingElement
Originating element. This may be an annotation processing element, a classpath scanningClassInfo
, or aTypeName
. Not type will cause an exception, each environment may check the instance and use it or not.- Returns:
- originating element of this exception
-
toEvent
Create a codegen event to log withCodegenLogger.log(CodegenEvent)
.- Parameters:
level
- log level to usemessage
- additional message describing the location- Returns:
- a new codegen event that can be directly logged
-
toEvent
Create a codegen event to log withCodegenLogger.log(CodegenEvent)
.- Parameters:
level
- log level to use- Returns:
- a new codegen event that can be directly logged
-