org.hibernate.validator.internal.metadata.location
Class MethodConstraintLocation

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

public class MethodConstraintLocation
extends Object
implements ConstraintLocation

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

Author:
Gunnar Morling

Constructor Summary
MethodConstraintLocation(Method method)
           
MethodConstraintLocation(Method method, int parameterIndex)
          Creates a new MethodConstraintLocation.
 
Method Summary
 boolean equals(Object obj)
           
 Class<?> getBeanClass()
           
 ElementType getElementType()
           
 Method getMember()
           
 Integer getParameterIndex()
           
 Class<?> getParameterType()
           
 int hashCode()
           
 String toString()
           
 Type typeOfAnnotatedElement()
          Returns the type of the element at this constraint location.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodConstraintLocation

public MethodConstraintLocation(Method method)

MethodConstraintLocation

public MethodConstraintLocation(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 Class<?> getBeanClass()
Specified by:
getBeanClass in interface ConstraintLocation

typeOfAnnotatedElement

public 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.

getMember

public Method getMember()
Specified by:
getMember in interface ConstraintLocation

getElementType

public ElementType getElementType()
Specified by:
getElementType in interface ConstraintLocation

getParameterIndex

public Integer getParameterIndex()
Returns:
returns the parameter index of this constraint location or null if this location represents a method return value.

getParameterType

public Class<?> getParameterType()

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2012 Oracle Corporation. All Rights Reserved.