private List < String > getVariables ( String routePath ) { List < String > variables = new ArrayList < String > ( ) ; Matcher matcher = Pattern . compile ( Path . VAR_REGEXP ) . matcher ( routePath ) ; while ( matcher . find ( ) ) { // group(0) always stands for the entire expression and we only want what is inside the {} variables . add ( matcher . group ( 1 ) ) ; } return variables ; }
Helper method . Retrieves all the variables defined in the path .