code: private boolean isValidCharForPath(char c, boolean openedKey) {
  		char[] invalidChars = { '?', '#', ' ' };
  		for (char invalidChar : invalidChars) {
  			if (c == invalidChar) {
  				return false;
  			}
  		}
  
  		if (openedKey) {
  			char[] moreInvalidChars = { '/', '{' };
  			for (char invalidChar : moreInvalidChars) {
  				if (c == invalidChar) {
  					return false;
  				}
  			}
  		}
  
  		return true;
  	}
docs: Helper method. Tells if a char is valid in a the path of a route line.
  
  @param c the char that we are validating.
  @param openedKey if there is already an opened key ({) char before.
  
  @return true if the char is valid, false otherwise.