public interface ConstraintLocation
Note that while the validation engine works on the aggregated meta-model (which e.g. provides a unified view for properties, be them represented via fields or getter methods) most of the time, in some situations the physical element which hosts a constraint is relevant. This includes
Modifier and Type | Interface and Description |
---|---|
static class |
ConstraintLocation.ConstraintLocationKind |
Modifier and Type | Method and Description |
---|---|
void |
appendTo(ExecutableParameterNameProvider parameterNameProvider,
PathImpl path)
Appends a node representing this location to the given property path.
|
static ConstraintLocation |
forClass(Class<?> declaringClass) |
static ConstraintLocation |
forCrossParameter(Callable callable) |
static ConstraintLocation |
forField(Field field) |
static ConstraintLocation |
forGetter(Getter getter) |
static ConstraintLocation |
forParameter(Callable callable,
int index) |
static ConstraintLocation |
forReturnValue(Callable callable) |
static ConstraintLocation |
forTypeArgument(ConstraintLocation delegate,
TypeVariable<?> typeParameter,
Type typeOfAnnotatedElement) |
Constrainable |
getConstrainable()
Returns the member represented by this location.
|
Class<?> |
getDeclaringClass()
Returns the class hosting this location.
|
ConstraintLocation.ConstraintLocationKind |
getKind()
Returns the nature of the constraint location.
|
Type |
getTypeForValidatorResolution()
Returns the type to be used when resolving constraint validators for constraints at this location.
|
Object |
getValue(Object parent)
Obtains the value of this location from the parent.
|
static ConstraintLocation forClass(Class<?> declaringClass)
static ConstraintLocation forField(Field field)
static ConstraintLocation forGetter(Getter getter)
static ConstraintLocation forTypeArgument(ConstraintLocation delegate, TypeVariable<?> typeParameter, Type typeOfAnnotatedElement)
static ConstraintLocation forReturnValue(Callable callable)
static ConstraintLocation forCrossParameter(Callable callable)
static ConstraintLocation forParameter(Callable callable, int index)
Class<?> getDeclaringClass()
Constrainable getConstrainable()
null
when this location represents a type.Type getTypeForValidatorResolution()
void appendTo(ExecutableParameterNameProvider parameterNameProvider, PathImpl path)
Object getValue(Object parent)
AbstractPropertyConstraintLocation
but an
object array for a ParameterConstraintLocation
.ConstraintLocation.ConstraintLocationKind getKind()
Copyright © 2007-2021 Red Hat, Inc. All Rights Reserved