@ Deprecated public static BasicDBObject parseFieldsString ( final String str , final Class clazz , final Mapper mapper , final boolean validate ) { BasicDBObject ret = new BasicDBObject ( ) ; final String [ ] parts = str . split ( "," ) ; for ( String s : parts ) { s = s . trim ( ) ; int dir = 1 ; if ( s . startsWith ( "-" ) ) { dir = - 1 ; s = s . substring ( 1 ) . trim ( ) ; } if ( validate ) { s = new PathTarget ( mapper , clazz , s ) . translatedPath ( ) ; } ret . put ( s , dir ) ; } return ret ; }
Parses the string and validates each part