private String[] tokenize(String query) {
		int position = 0;
		boolean inQuotes = false;
		ArrayList<String> words = new ArrayList<String>();
		
		StringBuilder sb = new StringBuilder();
		while (position < query.length()) {
			char c = query.charAt(position++);
			
			if (inQuotes) {
				if (c == '"') {
					words.add(sb.toString());
					sb.setLength(0);
				} else {
					sb.append(c);
				}
			} else if (c == '{' && sb.length() > 0) {
				words.add(sb.toString());
				sb.setLength(0);
				sb.append(c);
			} else if (c == ' ') {
				words.add(sb.toString());
				sb.setLength(0);
			} else if (c != '"') {
				sb.append(c);
			}
			
			if (c == '"') {
				inQuotes = !inQuotes;
			}
		}
		
		if (sb.length() > 0) {
			words.add(sb.toString());
		}
		
		return words.toArray(new String[words.size()]);
	}