01: package com.uwyn.rife.engine.exceptions;
02:
03: import com.uwyn.rife.tools.ClassUtils;
04:
05: import java.lang.reflect.Method;
06:
07: public class PropertyNameMismatchErrorException extends
08: ElementAnnotationErrorException {
09: private static final long serialVersionUID = 6625193529545213419L;
10:
11: private Class mAnnotationType = null;
12: private Method mMethod = null;
13: private String mExpectedPropertyName = null;
14: private String mActualPropertyName = null;
15:
16: public PropertyNameMismatchErrorException(
17: String implementationName, String siteDeclarationName,
18: Method method, Class annotationType, String expected,
19: String actual) {
20: super (implementationName, siteDeclarationName, "@"
21: + ClassUtils.simpleClassName(annotationType)
22: + " on method '" + method.getName()
23: + "' declares the property name to be '" + expected
24: + "', while it is '" + actual + "'.", null);
25:
26: mAnnotationType = annotationType;
27: mMethod = method;
28: mExpectedPropertyName = expected;
29: mActualPropertyName = actual;
30: }
31:
32: public Method getMethod() {
33: return mMethod;
34: }
35:
36: public Class getAnnotationType() {
37: return mAnnotationType;
38: }
39:
40: public String getExpectedPropertyName() {
41: return mExpectedPropertyName;
42: }
43:
44: public String getActualPropertyName() {
45: return mActualPropertyName;
46: }
47: }
|