1
2
3
4
5
6 package org.weda.property.impl;
7
8 import java.lang.reflect.Method;
9
10 /**
11 *
12 * @author Mikhail Titov
13 */
14 public class ConstraintCheckMethod {
15 private Method checkMethod;
16 private Class[] parameterTypes;
17 private Class valueType;
18
19 public ConstraintCheckMethod(Method checkMethod) {
20 this.checkMethod = checkMethod;
21 Class[] methodParameters = checkMethod.getParameterTypes();
22 valueType = methodParameters[0];
23 if (methodParameters.length > 1){
24 parameterTypes = new Class[methodParameters.length-1];
25 System.arraycopy(
26 methodParameters, 1
27 , parameterTypes, 0, parameterTypes.length);
28 }
29 }
30
31 public Method getCheckMethod() {
32 return checkMethod;
33 }
34
35 public Class getValueType(){
36 return valueType;
37 }
38
39 public Class[] getParameterTypes(){
40 return parameterTypes;
41 }
42
43 }