org.hibernate.validator.engine
Class MethodConstraintViolationImpl<T>

java.lang.Object
  extended by org.hibernate.validator.engine.ConstraintViolationImpl<T>
      extended by org.hibernate.validator.engine.MethodConstraintViolationImpl<T>
All Implemented Interfaces:
Serializable, ConstraintViolation<T>, MethodConstraintViolation<T>

public class MethodConstraintViolationImpl<T>
extends ConstraintViolationImpl<T>
implements MethodConstraintViolation<T>

Author:
Gunnar Morling
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.hibernate.validator.method.MethodConstraintViolation
MethodConstraintViolation.Kind
 
Constructor Summary
MethodConstraintViolationImpl(String messageTemplate, String interpolatedMessage, Method method, Integer parameterIndex, String parameterName, Class<T> rootBeanClass, T rootBean, Object leafBeanInstance, Object value, Path propertyPath, ConstraintDescriptor<?> constraintDescriptor, ElementType elementType)
           
 
Method Summary
 boolean equals(Object obj)
           
 MethodConstraintViolation.Kind getKind()
          Returns the kind of this method constraint violation.
 Method getMethod()
          Returns the method during which's validation this constraint violation occurred.
 Integer getParameterIndex()
          Returns the index of the parameter holding the constraint which caused this constraint violation.
 String getParameterName()
           Returns the name of the parameter holding the constraint which caused this constraint violation.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class org.hibernate.validator.engine.ConstraintViolationImpl
getConstraintDescriptor, getInvalidValue, getLeafBean, getMessage, getMessageTemplate, getPropertyPath, getRootBean, getRootBeanClass
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.validation.ConstraintViolation
getConstraintDescriptor, getInvalidValue, getLeafBean, getMessage, getMessageTemplate, getPropertyPath, getRootBean, getRootBeanClass
 

Constructor Detail

MethodConstraintViolationImpl

public MethodConstraintViolationImpl(String messageTemplate,
                                     String interpolatedMessage,
                                     Method method,
                                     Integer parameterIndex,
                                     String parameterName,
                                     Class<T> rootBeanClass,
                                     T rootBean,
                                     Object leafBeanInstance,
                                     Object value,
                                     Path propertyPath,
                                     ConstraintDescriptor<?> constraintDescriptor,
                                     ElementType elementType)
Method Detail

getMethod

public Method getMethod()
Description copied from interface: MethodConstraintViolation
Returns the method during which's validation this constraint violation occurred.

Specified by:
getMethod in interface MethodConstraintViolation<T>
Returns:
The method during which's validation this constraint violation occurred.

getParameterIndex

public Integer getParameterIndex()
Description copied from interface: MethodConstraintViolation
Returns the index of the parameter holding the constraint which caused this constraint violation.

Specified by:
getParameterIndex in interface MethodConstraintViolation<T>
Returns:
The index of the parameter holding the constraint which caused this constraint violation or null if this constraint violation is not of MethodConstraintViolation.Kind.PARAMETER.

getParameterName

public String getParameterName()
Description copied from interface: MethodConstraintViolation

Returns the name of the parameter holding the constraint which caused this constraint violation.

Currently a synthetic name following the form "arg" + index will be returned, e.g. "arg0". In future versions it might be possible to specify real parameter names, e.g. using an annotation-based approach around javax.inject.Named.

Specified by:
getParameterName in interface MethodConstraintViolation<T>
Returns:
The name of the parameter holding the constraint which caused this constraint violation or null if this constraint violation is not of MethodConstraintViolation.Kind.PARAMETER.

getKind

public MethodConstraintViolation.Kind getKind()
Description copied from interface: MethodConstraintViolation
Returns the kind of this method constraint violation.

Specified by:
getKind in interface MethodConstraintViolation<T>
Returns:
The kind of this method constraint violation.

hashCode

public int hashCode()
Overrides:
hashCode in class ConstraintViolationImpl<T>

equals

public boolean equals(Object obj)
Overrides:
equals in class ConstraintViolationImpl<T>

toString

public String toString()
Overrides:
toString in class ConstraintViolationImpl<T>


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