private Properties takeFreeArgsAsProperties ( Properties properties , int from ) { Properties result = new Properties ( ) ; for ( int i = from ; true ; i ++ ) { String nextFreeArg = properties . getProperty ( Integer . toString ( i ) ) ; // Terminate the loop once all free arguments have been consumed. if ( nextFreeArg == null ) { break ; } // Split it on the =, strip any whitespace and set it as a system property. String [ ] nameValuePair = nextFreeArg . split ( "=" ) ; if ( nameValuePair . length == 2 ) { result . setProperty ( nameValuePair [ 0 ] , nameValuePair [ 1 ] ) ; } } return result ; }
Converts the free arguments into property declarations . After parsing the command line the free arguments are numbered from 1 such that the parsed properties contain values for the keys 1 2 ... This method converts any free arguments declared using the name = value syntax into properties with key name value value .