public void process ( ) throws CmdLineException { ProcessingContext context = new ProcessingContext ( ) ; for ( String arg : this . args ) { if ( arg != null && ! context . processPendingOptionAction ( arg ) && ! context . processOptionAction ( arg , this . optionActions ) && ! context . processSwitchAction ( arg , this . switchActions ) ) { // No action found so far. Invoke the corresponding default action. Consumer < String > defaultAction = ( isActionArg ( arg ) ? this . unknownAction : this . unnamedAction ) ; if ( defaultAction != null ) { try { defaultAction . accept ( arg ) ; } catch ( RuntimeException e ) { throw new CmdLineException ( this , arg , e ) ; } } else { throw new CmdLineException ( this , arg ) ; } } } context . verifyNoPendingOptionAction ( ) ; }
Processes the command line and invoke the correspond actions .