java.lang.annotation

Class AnnotationTypeMismatchException

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

Constructor Summary
AnnotationTypeMismatchException(Method m, String type)
Constructs an AnnotationTypeMismatchException which is due to a mismatched type in the annotation element, m.
Method Summary
Methodelement()
Returns the element from the annotation, for which a mismatch occurred.
StringfoundType()
Returns the erroneous type used by the element, represented as a String.

Constructor Detail

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.

Method Detail

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.