1
1
/*
2
- * Copyright 2002-2015 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -87,10 +87,10 @@ public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA
87
87
}
88
88
}
89
89
90
+
90
91
private int autoGrowCollectionLimit = Integer .MAX_VALUE ;
91
92
92
- /** The wrapped object */
93
- private Object object ;
93
+ Object wrappedObject ;
94
94
95
95
private String nestedPath = "" ;
96
96
@@ -204,23 +204,23 @@ public void setWrappedInstance(Object object) {
204
204
public void setWrappedInstance (Object object , String nestedPath , Object rootObject ) {
205
205
Assert .notNull (object , "Target object must not be null" );
206
206
if (object .getClass () == javaUtilOptionalClass ) {
207
- this .object = OptionalUnwrapper .unwrap (object );
207
+ this .wrappedObject = OptionalUnwrapper .unwrap (object );
208
208
}
209
209
else {
210
- this .object = object ;
210
+ this .wrappedObject = object ;
211
211
}
212
212
this .nestedPath = (nestedPath != null ? nestedPath : "" );
213
- this .rootObject = (!"" .equals (this .nestedPath ) ? rootObject : this .object );
213
+ this .rootObject = (!"" .equals (this .nestedPath ) ? rootObject : this .wrappedObject );
214
214
this .nestedPropertyAccessors = null ;
215
- this .typeConverterDelegate = new TypeConverterDelegate (this , this .object );
215
+ this .typeConverterDelegate = new TypeConverterDelegate (this , this .wrappedObject );
216
216
}
217
217
218
218
public final Object getWrappedInstance () {
219
- return this .object ;
219
+ return this .wrappedObject ;
220
220
}
221
221
222
222
public final Class <?> getWrappedClass () {
223
- return (this .object != null ? this .object .getClass () : null );
223
+ return (this .wrappedObject != null ? this .wrappedObject .getClass () : null );
224
224
}
225
225
226
226
/**
@@ -303,7 +303,7 @@ protected void setPropertyValue(PropertyTokenHolder tokens, PropertyValue pv) th
303
303
catch (NotReadablePropertyException ex ) {
304
304
throw new NotWritablePropertyException (getRootClass (), this .nestedPath + propertyName ,
305
305
"Cannot access indexed value in property referenced " +
306
- "in indexed property path '" + propertyName + "'" , ex );
306
+ "in indexed property path '" + propertyName + "'" , ex );
307
307
}
308
308
// Set value for last key.
309
309
String key = tokens .keys [tokens .keys .length - 1 ];
@@ -318,7 +318,7 @@ protected void setPropertyValue(PropertyTokenHolder tokens, PropertyValue pv) th
318
318
else {
319
319
throw new NullValueInNestedPathException (getRootClass (), this .nestedPath + propertyName ,
320
320
"Cannot access indexed value in property referenced " +
321
- "in indexed property path '" + propertyName + "': returned null" );
321
+ "in indexed property path '" + propertyName + "': returned null" );
322
322
}
323
323
}
324
324
if (propValue .getClass ().isArray ()) {
@@ -367,8 +367,8 @@ else if (propValue instanceof List) {
367
367
catch (NullPointerException ex ) {
368
368
throw new InvalidPropertyException (getRootClass (), this .nestedPath + propertyName ,
369
369
"Cannot set element with index " + index + " in List of size " +
370
- size + ", accessed using property path '" + propertyName +
371
- "': List does not support filling up gaps with null elements" );
370
+ size + ", accessed using property path '" + propertyName +
371
+ "': List does not support filling up gaps with null elements" );
372
372
}
373
373
}
374
374
list .add (convertedValue );
@@ -405,7 +405,7 @@ else if (propValue instanceof Map) {
405
405
else {
406
406
throw new InvalidPropertyException (getRootClass (), this .nestedPath + propertyName ,
407
407
"Property referenced in indexed property path '" + propertyName +
408
- "' is neither an array nor a List nor a Map; returned value was [" + propValue + "]" );
408
+ "' is neither an array nor a List nor a Map; returned value was [" + propValue + "]" );
409
409
}
410
410
}
411
411
@@ -451,7 +451,7 @@ else if (propValue instanceof Map) {
451
451
}
452
452
pv .getOriginalPropertyValue ().conversionNecessary = (valueToApply != originalValue );
453
453
}
454
- ph .setValue (object , valueToApply );
454
+ ph .setValue (this . wrappedObject , valueToApply );
455
455
}
456
456
catch (TypeMismatchException ex ) {
457
457
throw ex ;
@@ -953,10 +953,9 @@ private PropertyTokenHolder getPropertyNameTokens(String propertyName) {
953
953
tokens .actualName = (actualName != null ? actualName : propertyName );
954
954
tokens .canonicalName = tokens .actualName ;
955
955
if (!keys .isEmpty ()) {
956
- tokens .canonicalName +=
957
- PROPERTY_KEY_PREFIX +
958
- StringUtils .collectionToDelimitedString (keys , PROPERTY_KEY_SUFFIX + PROPERTY_KEY_PREFIX ) +
959
- PROPERTY_KEY_SUFFIX ;
956
+ tokens .canonicalName += PROPERTY_KEY_PREFIX +
957
+ StringUtils .collectionToDelimitedString (keys , PROPERTY_KEY_SUFFIX + PROPERTY_KEY_PREFIX ) +
958
+ PROPERTY_KEY_SUFFIX ;
960
959
tokens .keys = StringUtils .toStringArray (keys );
961
960
}
962
961
return tokens ;
@@ -965,8 +964,8 @@ private PropertyTokenHolder getPropertyNameTokens(String propertyName) {
965
964
@ Override
966
965
public String toString () {
967
966
StringBuilder sb = new StringBuilder (getClass ().getName ());
968
- if (this .object != null ) {
969
- sb .append (": wrapping object [" ).append (ObjectUtils .identityToString (this .object )).append ("]" );
967
+ if (this .wrappedObject != null ) {
968
+ sb .append (": wrapping object [" ).append (ObjectUtils .identityToString (this .wrappedObject )).append ("]" );
970
969
}
971
970
else {
972
971
sb .append (": no wrapped object set" );
0 commit comments