Package net.sf.jabref.util

Examples of net.sf.jabref.util.QuotedStringTokenizer


      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:
View Full Code Here


    if (!s.startsWith(ID))
      throw new Exception(
          "Internal error: SearchGroup 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:
    case 1:
    case 2: {
      String name = tok.nextToken();
      String expression = tok.nextToken();
      boolean caseSensitive = Integer.parseInt(tok.nextToken()) == 1;
      boolean regExp = Integer.parseInt(tok.nextToken()) == 1;
      // version 0 contained 4 additional booleans to specify search
      // fields; these are ignored now, all fields are always searched
      return new SearchGroup(Util.unquote(name, QUOTE_CHAR), Util
          .unquote(expression, QUOTE_CHAR), caseSensitive, regExp,
          AbstractGroup.INDEPENDENT);
    }
    case 3: {
      String name = tok.nextToken();
      int context = Integer.parseInt(tok.nextToken());
      String expression = tok.nextToken();
      boolean caseSensitive = Integer.parseInt(tok.nextToken()) == 1;
      boolean regExp = Integer.parseInt(tok.nextToken()) == 1;
      // version 0 contained 4 additional booleans to specify search
      // fields; these are ignored now, all fields are always searched
      return new SearchGroup(Util.unquote(name, QUOTE_CHAR), Util
          .unquote(expression, QUOTE_CHAR), caseSensitive, regExp,
          context);
View Full Code Here

            throw new Exception(
                    "Internal error: ExplicitGroup 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:
        case 1:
        case 2: {
            ExplicitGroup newGroup = new ExplicitGroup(tok.nextToken(),
                    AbstractGroup.INDEPENDENT);
            newGroup.addEntries(tok, db);
            return newGroup;
        }
        case 3: {
            String name = tok.nextToken();
            int context = Integer.parseInt(tok.nextToken());
            ExplicitGroup newGroup = new ExplicitGroup(name, context);
            newGroup.addEntries(tok, db);
            return newGroup;
        }
        default:
View Full Code Here

TOP

Related Classes of net.sf.jabref.util.QuotedStringTokenizer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.