Package org.int4.dirk.api.definition
Class DefinitionException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.int4.dirk.api.definition.DefinitionException
-
- All Implemented Interfaces:
java.io.Serializable
public class DefinitionException extends java.lang.RuntimeExceptionThrown during registration of types or instances when the type is incorrectly annotated, cannot be constructed or cannot be injected. Retrying the registration will not solve problems of this type and generally points to annotation, visibility or type definition problems. For example:- No suitable or ambiguous constructor, for example when no constructors or multiple constructors are inject annotated
- Injection annotation on a final field or setter without parameters
- Conflicting scope annotations
- Registering an abstract type or a generic type with unresolvable type variables
- Using non-qualifier annotations when registering an instance
Definition problems can generally be solved by changing the types involved, like adding or removing annotations, changing visibility of fields or methods, etc.; reconfiguring the injector with different annotations or extensions may also solve definition problems.
Note: this exception specifically does not signal context sensitive problems that could be solved by registering or unregistering additional types; these are considered resolution problems, not definition problems.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefinitionException(java.lang.reflect.AnnotatedElement element, java.lang.String message)Constructs a new instance.DefinitionException(java.lang.reflect.AnnotatedElement element, java.lang.String message, java.lang.Throwable cause)Constructs a new instance.
-
-
-
Constructor Detail
-
DefinitionException
public DefinitionException(java.lang.reflect.AnnotatedElement element, java.lang.String message, java.lang.Throwable cause)Constructs a new instance.- Parameters:
element- anAnnotatedElementinvolved in the definition problem, cannot benullmessage- a message describing the problem, cannot benullcause- an underlying cause of the problem, can benull
-
DefinitionException
public DefinitionException(java.lang.reflect.AnnotatedElement element, java.lang.String message)Constructs a new instance.- Parameters:
element- anAnnotatedElementinvolved in the definition problem, cannot benullmessage- a message describing the problem, cannot benull
-
-