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

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

public class BeanConstraintLocation
extends Object
implements ConstraintLocation

A ConstraintLocation implementation that represents either a bean (in case of class-level constraints), a field or a getter method (in case of property-level constraints).

Author:
Hardy Ferentschik, Gunnar Morling

Constructor Summary
BeanConstraintLocation(Class<?> beanClass)
           
BeanConstraintLocation(Class<?> beanClass, Member member)
           
BeanConstraintLocation(Member member)
           
 
Method Summary
 boolean equals(Object o)
           
 Class<?> getBeanClass()
          Returns the class on which the constraint is defined.
 ElementType getElementType()
          Returns the ElementType on which the constraint is defined.
 Member getMember()
          Returns the member the constraint is defined on.
 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

BeanConstraintLocation

public BeanConstraintLocation(Class<?> beanClass)

BeanConstraintLocation

public BeanConstraintLocation(Member member)

BeanConstraintLocation

public BeanConstraintLocation(Class<?> beanClass,
                              Member member)
Parameters:
beanClass - The class in which the constraint is defined on
member - The member on which the constraint is defined on, null if it is a class constraint}
Method Detail

getBeanClass

public Class<?> getBeanClass()
Description copied from interface: ConstraintLocation
Returns the class on which the constraint is defined.

Specified by:
getBeanClass in interface ConstraintLocation
Returns:
the class on which the constraint is defined.

getMember

public Member getMember()
Description copied from interface: ConstraintLocation
Returns the member the constraint is defined on.

Specified by:
getMember in interface ConstraintLocation
Returns:
the member the constraint is defined on.

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.

getElementType

public ElementType getElementType()
Description copied from interface: ConstraintLocation
Returns the ElementType on which the constraint is defined.

Specified by:
getElementType in interface ConstraintLocation
Returns:
the ElementType on which the constraint is defined.

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2013 Red Hat Middleware, LLC. All Rights Reserved