Class ParameterConstraintLocation
- java.lang.Object
-
- org.hibernate.validator.internal.metadata.location.ParameterConstraintLocation
-
- All Implemented Interfaces:
ConstraintLocation
public class ParameterConstraintLocation extends Object implements ConstraintLocation
Parameter constraint location.- Author:
- Hardy Ferentschik, Gunnar Morling, Guillaume Smet
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.validator.internal.metadata.location.ConstraintLocation
ConstraintLocation.ConstraintLocationKind
-
-
Constructor Summary
Constructors Constructor Description ParameterConstraintLocation(Callable callable, int index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendTo(ExecutableParameterNameProvider parameterNameProvider, PathImpl path)Appends a node representing this location to the given property path.booleanequals(Object obj)ConstrainablegetConstrainable()Returns the member represented by this location.Class<?>getDeclaringClass()Returns the class hosting this location.intgetIndex()ConstraintLocation.ConstraintLocationKindgetKind()Returns the nature of the constraint location.TypegetTypeForValidatorResolution()Returns the type to be used when resolving constraint validators for constraints at this location.ObjectgetValue(Object parent)Obtains the value of this location from the parent.inthashCode()StringtoString()
-
-
-
Constructor Detail
-
ParameterConstraintLocation
public ParameterConstraintLocation(Callable callable, int index)
-
-
Method Detail
-
getDeclaringClass
public Class<?> getDeclaringClass()
Description copied from interface:ConstraintLocationReturns the class hosting this location.- Specified by:
getDeclaringClassin interfaceConstraintLocation
-
getConstrainable
public Constrainable getConstrainable()
Description copied from interface:ConstraintLocationReturns the member represented by this location.- Specified by:
getConstrainablein interfaceConstraintLocation- Returns:
- the member represented by this location. Will be
nullwhen this location represents a type.
-
getTypeForValidatorResolution
public Type getTypeForValidatorResolution()
Description copied from interface:ConstraintLocationReturns the type to be used when resolving constraint validators for constraints at this location. Note that this is not always the same type as the type of the element described by this location; E.g. the wrapper type will is used for constraint validator resolution, if a constraint is declared in an element with a primitive type.- Specified by:
getTypeForValidatorResolutionin interfaceConstraintLocation- Returns:
- The type to be used when resolving constraint validators for constraints at this location
-
getIndex
public int getIndex()
-
appendTo
public void appendTo(ExecutableParameterNameProvider parameterNameProvider, PathImpl path)
Description copied from interface:ConstraintLocationAppends a node representing this location to the given property path.- Specified by:
appendToin interfaceConstraintLocation
-
getValue
public Object getValue(Object parent)
Description copied from interface:ConstraintLocationObtains the value of this location from the parent. The type of the passed parent depends on the location type, e.g. a bean would be passed for aAbstractPropertyConstraintLocationbut an object array for aParameterConstraintLocation.- Specified by:
getValuein interfaceConstraintLocation
-
getKind
public ConstraintLocation.ConstraintLocationKind getKind()
Description copied from interface:ConstraintLocationReturns the nature of the constraint location.- Specified by:
getKindin interfaceConstraintLocation
-
-