38
38
import org .hibernate .validator .internal .engine .groups .Sequence ;
39
39
import org .hibernate .validator .internal .engine .groups .ValidationOrder ;
40
40
import org .hibernate .validator .internal .engine .groups .ValidationOrderGenerator ;
41
+ import org .hibernate .validator .internal .engine .path .ModifiablePath ;
41
42
import org .hibernate .validator .internal .engine .path .NodeImpl ;
42
- import org .hibernate .validator .internal .engine .path .PathImpl ;
43
43
import org .hibernate .validator .internal .engine .resolver .TraversableResolvers ;
44
44
import org .hibernate .validator .internal .engine .validationcontext .BaseBeanValidationContext ;
45
45
import org .hibernate .validator .internal .engine .validationcontext .ExecutableValidationContext ;
@@ -164,7 +164,7 @@ public final <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... grou
164
164
validatorScopedContext .getParameterNameProvider (),
165
165
object ,
166
166
validationContext .getRootBeanMetaData (),
167
- PathImpl .createRootPath ()
167
+ ModifiablePath .createRootPath ()
168
168
);
169
169
170
170
return validateInContext ( validationContext , valueContext , validationOrder );
@@ -184,7 +184,7 @@ public final <T> Set<ConstraintViolation<T>> validateProperty(T object, String p
184
184
return Collections .emptySet ();
185
185
}
186
186
187
- PathImpl propertyPath = PathImpl .createPathFromString ( propertyName );
187
+ ModifiablePath propertyPath = ModifiablePath .createPathFromString ( propertyName );
188
188
BaseBeanValidationContext <T > validationContext = getValidationContextBuilder ().forValidateProperty ( rootBeanClass , rootBeanMetaData , object ,
189
189
propertyPath );
190
190
@@ -211,7 +211,7 @@ public final <T> Set<ConstraintViolation<T>> validateValue(Class<T> beanType, St
211
211
return Collections .emptySet ();
212
212
}
213
213
214
- PathImpl propertyPath = PathImpl .createPathFromString ( propertyName );
214
+ ModifiablePath propertyPath = ModifiablePath .createPathFromString ( propertyName );
215
215
BaseBeanValidationContext <T > validationContext = getValidationContextBuilder ().forValidateValue ( beanType , rootBeanMetaData , propertyPath );
216
216
217
217
ValidationOrder validationOrder = determineGroupValidationOrder ( groups );
@@ -813,7 +813,7 @@ private BeanValueContext<?, Object> buildNewLocalExecutionContext(ValueContext<?
813
813
return newValueContext ;
814
814
}
815
815
816
- private <T > Set <ConstraintViolation <T >> validateValueInContext (BaseBeanValidationContext <T > validationContext , Object value , PathImpl propertyPath ,
816
+ private <T > Set <ConstraintViolation <T >> validateValueInContext (BaseBeanValidationContext <T > validationContext , Object value , ModifiablePath propertyPath ,
817
817
ValidationOrder validationOrder ) {
818
818
BeanValueContext <?, Object > valueContext = getValueContextForValueValidation ( validationContext .getRootBeanClass (), propertyPath );
819
819
valueContext .setCurrentValidatedValue ( value );
@@ -902,7 +902,7 @@ private <T> void validateParametersInContext(ExecutableValidationContext<T> vali
902
902
validatorScopedContext .getParameterNameProvider (),
903
903
parameterValues ,
904
904
executableMetaData .getValidatableParametersMetaData (),
905
- PathImpl .createPathForExecutable ( executableMetaData )
905
+ ModifiablePath .createPathForExecutable ( executableMetaData )
906
906
);
907
907
908
908
groupIterator = validationOrder .getGroupIterator ();
@@ -1035,7 +1035,7 @@ private <T> ValueContext<T, Object> getExecutableValueContext(T object, Executab
1035
1035
validatorScopedContext .getParameterNameProvider (),
1036
1036
object ,
1037
1037
validatable ,
1038
- PathImpl .createPathForExecutable ( executableMetaData )
1038
+ ModifiablePath .createPathForExecutable ( executableMetaData )
1039
1039
);
1040
1040
1041
1041
valueContext .setCurrentGroup ( group );
@@ -1078,7 +1078,7 @@ private <V, T> void validateReturnValueInContext(ExecutableValidationContext<T>
1078
1078
validatorScopedContext .getParameterNameProvider (),
1079
1079
value ,
1080
1080
executableMetaData .getReturnValueMetaData (),
1081
- PathImpl .createPathForExecutable ( executableMetaData )
1081
+ ModifiablePath .createPathForExecutable ( executableMetaData )
1082
1082
);
1083
1083
1084
1084
groupIterator = validationOrder .getGroupIterator ();
@@ -1184,7 +1184,7 @@ private <T> void validateReturnValueForSingleGroup(BaseBeanValidationContext<T>
1184
1184
* @return Returns an instance of {@code ValueContext} which describes the local validation context associated to
1185
1185
* the given property path.
1186
1186
*/
1187
- private <V > BeanValueContext <?, V > getValueContextForPropertyValidation (BaseBeanValidationContext <?> validationContext , PathImpl propertyPath ) {
1187
+ private <V > BeanValueContext <?, V > getValueContextForPropertyValidation (BaseBeanValidationContext <?> validationContext , ModifiablePath propertyPath ) {
1188
1188
Class <?> clazz = validationContext .getRootBeanClass ();
1189
1189
BeanMetaData <?> beanMetaData = validationContext .getRootBeanMetaData ();
1190
1190
Object value = validationContext .getRootBean ();
@@ -1262,7 +1262,7 @@ else if ( propertyPathNode.getKey() != null ) {
1262
1262
* the given property path.
1263
1263
*/
1264
1264
private <V > BeanValueContext <?, V > getValueContextForValueValidation (Class <?> rootBeanClass ,
1265
- PathImpl propertyPath ) {
1265
+ ModifiablePath propertyPath ) {
1266
1266
Class <?> clazz = rootBeanClass ;
1267
1267
BeanMetaData <?> beanMetaData = null ;
1268
1268
PropertyMetaData propertyMetaData = null ;
@@ -1330,13 +1330,13 @@ private boolean isValidationRequired(BaseBeanValidationContext<?> validationCont
1330
1330
);
1331
1331
}
1332
1332
1333
- private boolean isReachable (BaseBeanValidationContext <?> validationContext , Object traversableObject , PathImpl path ,
1333
+ private boolean isReachable (BaseBeanValidationContext <?> validationContext , Object traversableObject , ModifiablePath path ,
1334
1334
ConstraintLocationKind constraintLocationKind ) {
1335
1335
if ( needToCallTraversableResolver ( path , constraintLocationKind ) ) {
1336
1336
return true ;
1337
1337
}
1338
1338
1339
- Path pathToObject = PathImpl .createCopyWithoutLeafNode ( path );
1339
+ Path pathToObject = ModifiablePath .createCopyWithoutLeafNode ( path );
1340
1340
try {
1341
1341
return validationContext .getTraversableResolver ().isReachable (
1342
1342
traversableObject ,
@@ -1351,7 +1351,7 @@ private boolean isReachable(BaseBeanValidationContext<?> validationContext, Obje
1351
1351
}
1352
1352
}
1353
1353
1354
- private boolean needToCallTraversableResolver (PathImpl path , ConstraintLocationKind constraintLocationKind ) {
1354
+ private boolean needToCallTraversableResolver (ModifiablePath path , ConstraintLocationKind constraintLocationKind ) {
1355
1355
// as the TraversableResolver interface is designed right now it does not make sense to call it when
1356
1356
// there is no traversable object hosting the property to be accessed. For this reason we don't call the resolver
1357
1357
// for class level constraints (ElementType.TYPE) or top level method parameters or return values.
@@ -1362,7 +1362,7 @@ private boolean needToCallTraversableResolver(PathImpl path, ConstraintLocationK
1362
1362
|| isReturnValueValidation ( path );
1363
1363
}
1364
1364
1365
- private boolean isCascadeRequired (BaseBeanValidationContext <?> validationContext , Object traversableObject , PathImpl path ,
1365
+ private boolean isCascadeRequired (BaseBeanValidationContext <?> validationContext , Object traversableObject , ModifiablePath path ,
1366
1366
ConstraintLocationKind constraintLocationKind ) {
1367
1367
if ( needToCallTraversableResolver ( path , constraintLocationKind ) ) {
1368
1368
return true ;
@@ -1373,7 +1373,7 @@ private boolean isCascadeRequired(BaseBeanValidationContext<?> validationContext
1373
1373
return false ;
1374
1374
}
1375
1375
1376
- Path pathToObject = PathImpl .createCopyWithoutLeafNode ( path );
1376
+ Path pathToObject = ModifiablePath .createCopyWithoutLeafNode ( path );
1377
1377
try {
1378
1378
return validationContext .getTraversableResolver ().isCascadable (
1379
1379
traversableObject ,
@@ -1392,15 +1392,15 @@ private boolean isClassLevelConstraint(ConstraintLocationKind constraintLocation
1392
1392
return ConstraintLocationKind .TYPE .equals ( constraintLocationKind );
1393
1393
}
1394
1394
1395
- private boolean isCrossParameterValidation (PathImpl path ) {
1395
+ private boolean isCrossParameterValidation (ModifiablePath path ) {
1396
1396
return path .getLeafNode ().getKind () == ElementKind .CROSS_PARAMETER ;
1397
1397
}
1398
1398
1399
- private boolean isParameterValidation (PathImpl path ) {
1399
+ private boolean isParameterValidation (ModifiablePath path ) {
1400
1400
return path .getLeafNode ().getKind () == ElementKind .PARAMETER ;
1401
1401
}
1402
1402
1403
- private boolean isReturnValueValidation (PathImpl path ) {
1403
+ private boolean isReturnValueValidation (ModifiablePath path ) {
1404
1404
return path .getLeafNode ().getKind () == ElementKind .RETURN_VALUE ;
1405
1405
}
1406
1406
0 commit comments