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 ;
42
- import org .hibernate .validator .internal .engine .path .NodeImpl ;
41
+ import org .hibernate .validator .internal .engine .path .MutableNode ;
42
+ import org .hibernate .validator .internal .engine .path .MutablePath ;
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
- ModifiablePath .createRootPath ()
167
+ MutablePath .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
- ModifiablePath propertyPath = ModifiablePath .createPathFromString ( propertyName );
187
+ MutablePath propertyPath = MutablePath .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
- ModifiablePath propertyPath = ModifiablePath .createPathFromString ( propertyName );
214
+ MutablePath propertyPath = MutablePath .createPathFromString ( propertyName );
215
215
BaseBeanValidationContext <T > validationContext = getValidationContextBuilder ().forValidateValue ( beanType , rootBeanMetaData , propertyPath );
216
216
217
217
ValidationOrder validationOrder = determineGroupValidationOrder ( groups );
@@ -814,7 +814,7 @@ private BeanValueContext<?, Object> buildNewLocalExecutionContext(ValueContext<?
814
814
return newValueContext ;
815
815
}
816
816
817
- private <T > Set <ConstraintViolation <T >> validateValueInContext (BaseBeanValidationContext <T > validationContext , Object value , ModifiablePath propertyPath ,
817
+ private <T > Set <ConstraintViolation <T >> validateValueInContext (BaseBeanValidationContext <T > validationContext , Object value , MutablePath propertyPath ,
818
818
ValidationOrder validationOrder ) {
819
819
BeanValueContext <?, Object > valueContext = getValueContextForValueValidation ( validationContext .getRootBeanClass (), propertyPath );
820
820
valueContext .setCurrentValidatedValue ( value );
@@ -903,7 +903,7 @@ private <T> void validateParametersInContext(ExecutableValidationContext<T> vali
903
903
validatorScopedContext .getParameterNameProvider (),
904
904
parameterValues ,
905
905
executableMetaData .getValidatableParametersMetaData (),
906
- ModifiablePath .createPathForExecutable ( executableMetaData )
906
+ MutablePath .createPathForExecutable ( executableMetaData )
907
907
);
908
908
909
909
groupIterator = validationOrder .getGroupIterator ();
@@ -1036,7 +1036,7 @@ private <T> ValueContext<T, Object> getExecutableValueContext(T object, Executab
1036
1036
validatorScopedContext .getParameterNameProvider (),
1037
1037
object ,
1038
1038
validatable ,
1039
- ModifiablePath .createPathForExecutable ( executableMetaData )
1039
+ MutablePath .createPathForExecutable ( executableMetaData )
1040
1040
);
1041
1041
1042
1042
valueContext .setCurrentGroup ( group );
@@ -1079,7 +1079,7 @@ private <V, T> void validateReturnValueInContext(ExecutableValidationContext<T>
1079
1079
validatorScopedContext .getParameterNameProvider (),
1080
1080
value ,
1081
1081
executableMetaData .getReturnValueMetaData (),
1082
- ModifiablePath .createPathForExecutable ( executableMetaData )
1082
+ MutablePath .createPathForExecutable ( executableMetaData )
1083
1083
);
1084
1084
1085
1085
groupIterator = validationOrder .getGroupIterator ();
@@ -1185,7 +1185,7 @@ private <T> void validateReturnValueForSingleGroup(BaseBeanValidationContext<T>
1185
1185
* @return Returns an instance of {@code ValueContext} which describes the local validation context associated to
1186
1186
* the given property path.
1187
1187
*/
1188
- private <V > BeanValueContext <?, V > getValueContextForPropertyValidation (BaseBeanValidationContext <?> validationContext , ModifiablePath propertyPath ) {
1188
+ private <V > BeanValueContext <?, V > getValueContextForPropertyValidation (BaseBeanValidationContext <?> validationContext , MutablePath propertyPath ) {
1189
1189
Class <?> clazz = validationContext .getRootBeanClass ();
1190
1190
BeanMetaData <?> beanMetaData = validationContext .getRootBeanMetaData ();
1191
1191
Object value = validationContext .getRootBean ();
@@ -1195,7 +1195,7 @@ private <V> BeanValueContext<?, V> getValueContextForPropertyValidation(BaseBean
1195
1195
1196
1196
while ( propertyPathIter .hasNext () ) {
1197
1197
// cast is ok, since we are dealing with engine internal classes
1198
- NodeImpl propertyPathNode = (NodeImpl ) propertyPathIter .next ();
1198
+ MutableNode propertyPathNode = (MutableNode ) propertyPathIter .next ();
1199
1199
propertyMetaData = getBeanPropertyMetaData ( beanMetaData , propertyPathNode );
1200
1200
1201
1201
// if the property is not the leaf property, we set up the context for the next iteration
@@ -1214,7 +1214,7 @@ private <V> BeanValueContext<?, V> getValueContextForPropertyValidation(BaseBean
1214
1214
// if we are in the case of an iterable and we want to validate an element of this iterable, we have to get the
1215
1215
// element value
1216
1216
if ( propertyPathNode .isIterable () ) {
1217
- propertyPathNode = (NodeImpl ) propertyPathIter .next ();
1217
+ propertyPathNode = (MutableNode ) propertyPathIter .next ();
1218
1218
1219
1219
if ( propertyPathNode .getIndex () != null ) {
1220
1220
value = ReflectionHelper .getIndexedValue ( value , propertyPathNode .getIndex () );
@@ -1263,7 +1263,7 @@ else if ( propertyPathNode.getKey() != null ) {
1263
1263
* the given property path.
1264
1264
*/
1265
1265
private <V > BeanValueContext <?, V > getValueContextForValueValidation (Class <?> rootBeanClass ,
1266
- ModifiablePath propertyPath ) {
1266
+ MutablePath propertyPath ) {
1267
1267
Class <?> clazz = rootBeanClass ;
1268
1268
BeanMetaData <?> beanMetaData = null ;
1269
1269
PropertyMetaData propertyMetaData = null ;
@@ -1272,7 +1272,7 @@ private <V> BeanValueContext<?, V> getValueContextForValueValidation(Class<?> ro
1272
1272
1273
1273
while ( propertyPathIter .hasNext () ) {
1274
1274
// cast is ok, since we are dealing with engine internal classes
1275
- NodeImpl propertyPathNode = (NodeImpl ) propertyPathIter .next ();
1275
+ MutableNode propertyPathNode = (MutableNode ) propertyPathIter .next ();
1276
1276
beanMetaData = beanMetaDataManager .getBeanMetaData ( clazz );
1277
1277
propertyMetaData = getBeanPropertyMetaData ( beanMetaData , propertyPathNode );
1278
1278
@@ -1281,7 +1281,7 @@ private <V> BeanValueContext<?, V> getValueContextForValueValidation(Class<?> ro
1281
1281
// if we are in the case of an iterable and we want to validate an element of this iterable, we have to get the
1282
1282
// type from the parameterized type
1283
1283
if ( propertyPathNode .isIterable () ) {
1284
- propertyPathNode = (NodeImpl ) propertyPathIter .next ();
1284
+ propertyPathNode = (MutableNode ) propertyPathIter .next ();
1285
1285
1286
1286
clazz = ReflectionHelper .getClassFromType ( ReflectionHelper .getCollectionElementType ( propertyMetaData .getType () ) );
1287
1287
beanMetaData = beanMetaDataManager .getBeanMetaData ( clazz );
@@ -1330,13 +1330,13 @@ private boolean isValidationRequired(BaseBeanValidationContext<?> validationCont
1330
1330
);
1331
1331
}
1332
1332
1333
- private boolean isReachable (BaseBeanValidationContext <?> validationContext , Object traversableObject , ModifiablePath path ,
1333
+ private boolean isReachable (BaseBeanValidationContext <?> validationContext , Object traversableObject , MutablePath path ,
1334
1334
ConstraintLocationKind constraintLocationKind ) {
1335
1335
if ( needToCallTraversableResolver ( path , constraintLocationKind ) ) {
1336
1336
return true ;
1337
1337
}
1338
1338
1339
- Path pathToObject = ModifiablePath .createCopyWithoutLeafNode ( path );
1339
+ Path pathToObject = MutablePath .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 (ModifiablePath path , ConstraintLocationKind constraintLocationKind ) {
1354
+ private boolean needToCallTraversableResolver (MutablePath 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(ModifiablePath path, ConstraintLoc
1362
1362
|| isReturnValueValidation ( path );
1363
1363
}
1364
1364
1365
- private boolean isCascadeRequired (BaseBeanValidationContext <?> validationContext , Object traversableObject , ModifiablePath path ,
1365
+ private boolean isCascadeRequired (BaseBeanValidationContext <?> validationContext , Object traversableObject , MutablePath 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 = ModifiablePath .createCopyWithoutLeafNode ( path );
1376
+ Path pathToObject = MutablePath .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 (ModifiablePath path ) {
1395
+ private boolean isCrossParameterValidation (MutablePath path ) {
1396
1396
return path .getLeafNode ().getKind () == ElementKind .CROSS_PARAMETER ;
1397
1397
}
1398
1398
1399
- private boolean isParameterValidation (ModifiablePath path ) {
1399
+ private boolean isParameterValidation (MutablePath path ) {
1400
1400
return path .getLeafNode ().getKind () == ElementKind .PARAMETER ;
1401
1401
}
1402
1402
1403
- private boolean isReturnValueValidation (ModifiablePath path ) {
1403
+ private boolean isReturnValueValidation (MutablePath path ) {
1404
1404
return path .getLeafNode ().getKind () == ElementKind .RETURN_VALUE ;
1405
1405
}
1406
1406
0 commit comments