org.hibernate.validator.metadata.location
Class MethodConstraintLocation

java.lang.Object
  extended by org.hibernate.validator.metadata.location.MethodConstraintLocation
All Implemented Interfaces:
ConstraintLocation

public class MethodConstraintLocation
extends java.lang.Object
implements ConstraintLocation

A ConstraintLocation implementation that represents a method parameter or return value.

Author:
Gunnar Morling

Constructor Summary
MethodConstraintLocation(java.lang.reflect.Method method)
           
MethodConstraintLocation(java.lang.reflect.Method method, int parameterIndex)
          Creates a new MethodConstraintLocation.
 
Method Summary
 java.lang.Class<?> getBeanClass()
           
 java.lang.reflect.Method getMethod()
           
 java.lang.Integer getParameterIndex()
          The parameter index of this constraint location or null if this location represents a method return value.
 java.lang.String toString()
           
 java.lang.reflect.Type typeOfAnnotatedElement()
          Returns the type of the element at this constraint location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodConstraintLocation

public MethodConstraintLocation(java.lang.reflect.Method method)

MethodConstraintLocation

public MethodConstraintLocation(java.lang.reflect.Method method,
                                int parameterIndex)
Creates a new MethodConstraintLocation.

Parameters:
method - The method of the location to be created.
parameterIndex - The parameter index of the location to be created.
Method Detail

getBeanClass

public java.lang.Class<?> getBeanClass()
Specified by:
getBeanClass in interface ConstraintLocation

typeOfAnnotatedElement

public java.lang.reflect.Type typeOfAnnotatedElement()
Description copied from interface: ConstraintLocation
Returns the type of the element at this constraint location. Depending on the concrete implementation this might be the type of an annotated bean, method parameter etc.

Specified by:
typeOfAnnotatedElement in interface ConstraintLocation
Returns:
The type of the element at this constraint location.

getMethod

public java.lang.reflect.Method getMethod()

getParameterIndex

public java.lang.Integer getParameterIndex()
The parameter index of this constraint location or null if this location represents a method return value.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011 Oracle Corporation. All Rights Reserved.