throw new Exception(
"Internal error: KeywordGroup cannot be created from \""
+ s
+ "\". "
+ "Please report this on www.sf.net/projects/jabref");
QuotedStringTokenizer tok = new QuotedStringTokenizer(s.substring(ID
.length()), SEPARATOR, QUOTE_CHAR);
switch (version) {
case 0: {
String name = tok.nextToken();
String field = tok.nextToken();
String expression = tok.nextToken();
// assume caseSensitive=false and regExp=true for old groups
return new KeywordGroup(Util.unquote(name, QUOTE_CHAR), Util
.unquote(field, QUOTE_CHAR), Util.unquote(expression,
QUOTE_CHAR), false, true, AbstractGroup.INDEPENDENT);
}
case 1:
case 2: {
String name = tok.nextToken();
String field = tok.nextToken();
String expression = tok.nextToken();
boolean caseSensitive = Integer.parseInt(tok.nextToken()) == 1;
boolean regExp = Integer.parseInt(tok.nextToken()) == 1;
return new KeywordGroup(Util.unquote(name, QUOTE_CHAR), Util
.unquote(field, QUOTE_CHAR), Util.unquote(expression,
QUOTE_CHAR), caseSensitive, regExp,
AbstractGroup.INDEPENDENT);
}
case 3: {
String name = tok.nextToken();
int context = Integer.parseInt(tok.nextToken());
String field = tok.nextToken();
String expression = tok.nextToken();
boolean caseSensitive = Integer.parseInt(tok.nextToken()) == 1;
boolean regExp = Integer.parseInt(tok.nextToken()) == 1;
return new KeywordGroup(Util.unquote(name, QUOTE_CHAR), Util
.unquote(field, QUOTE_CHAR), Util.unquote(expression,
QUOTE_CHAR), caseSensitive, regExp, context);
}
default: