Trims all Strings encountered within an Object graph recursively.
This utility uses Java Reflection API to traverse through an object graph with disciplined syntax of getters and setters and recursively trims the String properties.
- If the current level of
Propertyis of typeString - If its an
ObjectArray of Properties - If its a
Stringarray - If its a type of Java
Collectionclass - Separate placement for
Mapwith special conditions to process itskeysandvalues
Next Steps
- Handle undisciplined syntax of properties (invalid getters/setters)
- Handle chained Collections: for example,
List<List<Person>> Guavacollection library support