1 /*
2  * Hibernate Validator, declare and validate application constraints
3  *
4  * License: Apache License, Version 2.0
5  * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
6  */

7 package org.hibernate.validator.internal.properties.javabean;
8
9 import java.lang.reflect.Method;
10 import java.lang.reflect.TypeVariable;
11
12 import org.hibernate.validator.internal.metadata.raw.ConstrainedElement.ConstrainedElementKind;
13
14 /**
15  * @author Guillaume Smet
16  */

17 public class JavaBeanMethod extends JavaBeanExecutable<Method> {
18
19     JavaBeanMethod(Method method) {
20         super( method, method.getGenericReturnType() != void.class );
21     }
22
23     @Override
24     public ConstrainedElementKind getConstrainedElementKind() {
25         return ConstrainedElementKind.METHOD;
26     }
27
28     @Override
29     public TypeVariable<?>[] getTypeParameters() {
30         return executable.getReturnType().getTypeParameters();
31     }
32 }
33