01: /*
02: * Created on 11 Sep 2007
03: */
04: package uk.org.ponder.rsf.view.support;
05:
06: import uk.org.ponder.rsf.view.ViewGroup;
07: import uk.org.ponder.stringutil.StringList;
08:
09: /** The parsed form of a viewID or contentType predicate from a {@link ViewGroup}
10: *
11: * @author Antranig Basman (antranig@caret.cam.ac.uk)
12: *
13: */
14:
15: public class ParsedPredicate {
16: public boolean positive = true;
17: public String[] elements;
18:
19: public static ParsedPredicate parse(String toparse) {
20: ParsedPredicate togo = new ParsedPredicate();
21: if (toparse == null || toparse.length() == 0)
22: return togo;
23: if (toparse.charAt(0) == '!') {
24: togo.positive = false;
25: }
26: togo.elements = StringList.fromString(toparse).toStringArray();
27: return togo;
28: }
29: }
|