public static String parseQueryFields ( UriInfo uriInfo ) { List < String > selectables = uriInfo . getQueryParameters ( ) . get ( EntityFieldsScopeResolver . FIELDS_PARAM_NAME ) ; StringBuilder builder = new StringBuilder ( ) ; if ( selectables != null ) { for ( int i = 0 ; i < selectables . size ( ) ; i ++ ) { String s = selectables . get ( i ) ; if ( StringUtils . isNotBlank ( s ) ) { if ( ! s . startsWith ( "(" ) ) { builder . append ( "(" ) ; } builder . append ( s ) ; if ( ! s . endsWith ( ")" ) ) { builder . append ( ")" ) ; } if ( i < selectables . size ( ) - 1 ) { builder . append ( ":" ) ; } } } } return builder . length ( ) == 0 ? null : builder . toString ( ) ; }
Parse and return a BeanPathProperties format from UriInfo