Class AbstractPropertyConstraintLocation<T extends Property>
- java.lang.Object
-
- org.hibernate.validator.internal.metadata.location.AbstractPropertyConstraintLocation<T>
-
- All Implemented Interfaces:
ConstraintLocation
- Direct Known Subclasses:
FieldConstraintLocation,GetterConstraintLocation
public abstract class AbstractPropertyConstraintLocation<T extends Property> extends Object implements ConstraintLocation
An abstract property constraint location.- Author:
- Marko Bekhta, Guillaume Smet
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.validator.internal.metadata.location.ConstraintLocation
ConstraintLocation.ConstraintLocationKind
-
-
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 o)TgetConstrainable()Returns the member represented by this location.Class<?>getDeclaringClass()Returns the class hosting this location.StringgetPropertyName()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()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.validator.internal.metadata.location.ConstraintLocation
getKind
-
-
-
-
Method Detail
-
getDeclaringClass
public Class<?> getDeclaringClass()
Description copied from interface:ConstraintLocationReturns the class hosting this location.- Specified by:
getDeclaringClassin interfaceConstraintLocation
-
getConstrainable
public T 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.
-
getPropertyName
public String getPropertyName()
-
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
-
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
-
-