org.hibernate.validator.engine
Class MethodConstraintViolationImpl<T>
java.lang.Object
org.hibernate.validator.engine.ConstraintViolationImpl<T>
org.hibernate.validator.engine.MethodConstraintViolationImpl<T>
- All Implemented Interfaces:
- java.io.Serializable, javax.validation.ConstraintViolation<T>, MethodConstraintViolation<T>
public class MethodConstraintViolationImpl<T>
- extends ConstraintViolationImpl<T>
- implements MethodConstraintViolation<T>
- Author:
- Gunnar Morling
- See Also:
- Serialized Form
|
Constructor Summary |
MethodConstraintViolationImpl(java.lang.String messageTemplate,
java.lang.String interpolatedMessage,
java.lang.reflect.Method method,
java.lang.Integer parameterIndex,
java.lang.String parameterName,
java.lang.Class<T> rootBeanClass,
T rootBean,
java.lang.Object leafBeanInstance,
java.lang.Object value,
javax.validation.Path propertyPath,
javax.validation.metadata.ConstraintDescriptor<?> constraintDescriptor,
java.lang.annotation.ElementType elementType)
|
|
Method Summary |
boolean |
equals(java.lang.Object obj)
|
MethodConstraintViolation.Kind |
getKind()
Returns the kind of this method constraint violation. |
java.lang.reflect.Method |
getMethod()
Returns the method during which's validation this constraint violation
occurred. |
java.lang.Integer |
getParameterIndex()
Returns the index of the parameter holding the constraint which caused
this constraint violation. |
java.lang.String |
getParameterName()
Returns the name of the parameter holding the constraint which caused
this constraint violation. |
int |
hashCode()
|
java.lang.String |
toString()
|
| 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 |
MethodConstraintViolationImpl
public MethodConstraintViolationImpl(java.lang.String messageTemplate,
java.lang.String interpolatedMessage,
java.lang.reflect.Method method,
java.lang.Integer parameterIndex,
java.lang.String parameterName,
java.lang.Class<T> rootBeanClass,
T rootBean,
java.lang.Object leafBeanInstance,
java.lang.Object value,
javax.validation.Path propertyPath,
javax.validation.metadata.ConstraintDescriptor<?> constraintDescriptor,
java.lang.annotation.ElementType elementType)
getMethod
public java.lang.reflect.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 java.lang.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 java.lang.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(java.lang.Object obj)
- Overrides:
equals in class ConstraintViolationImpl<T>
toString
public java.lang.String toString()
- Overrides:
toString in class ConstraintViolationImpl<T>
Copyright © 2011 Oracle Corporation. All Rights Reserved.