java.lang.annotation
Class AnnotationTypeMismatchException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.annotation.AnnotationTypeMismatchException
- All Implemented Interfaces:
- Serializable
public class AnnotationTypeMismatchException
- extends RuntimeException
Thrown when accessing an element within an annotation for
which the type has changed, since compilation or serialization
took place. The mismatch between the compiled or serialized
type and the current type causes this exception to be thrown.
- Since:
- 1.5
- See Also:
- Serialized Form
Method Summary |
Method |
element()
Returns the element from the annotation, for which a
mismatch occurred. |
String |
foundType()
Returns the erroneous type used by the element,
represented as a String . |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
AnnotationTypeMismatchException
public AnnotationTypeMismatchException(Method m,
String type)
- Constructs an
AnnotationTypeMismatchException
which is due to a mismatched type in the annotation
element, m
. The erroneous type used for the
data in m
is represented by the string,
type
. This string is of an undefined format,
and may contain the value as well as the type.
- Parameters:
m
- the element from the annotation.type
- the name of the erroneous type found in m
.
element
public Method element()
- Returns the element from the annotation, for which a
mismatch occurred.
- Returns:
- the element with the mismatched type.
foundType
public String foundType()
- Returns the erroneous type used by the element,
represented as a
String
. The format
of this String
is not explicitly specified,
and may contain the value as well as the type.
- Returns:
- the type found in the element.