01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: PathInfoMappingSegment.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.engine;
09:
10: import java.util.regex.Pattern;
11:
12: public class PathInfoMappingSegment {
13: private String mValue = null;
14: private Pattern mPattern = null;
15: private boolean mRegexp = false;
16:
17: private PathInfoMappingSegment(String value) {
18: mValue = value;
19: mPattern = null;
20: mRegexp = false;
21: }
22:
23: private PathInfoMappingSegment(Pattern pattern) {
24: mValue = null;
25: mPattern = pattern;
26: mRegexp = true;
27: }
28:
29: static PathInfoMappingSegment createLiteralSegment(String value) {
30: return new PathInfoMappingSegment(value);
31: }
32:
33: static PathInfoMappingSegment createRegexpSegment(Pattern pattern) {
34: return new PathInfoMappingSegment(pattern);
35: }
36:
37: public String getValue() {
38: return mValue;
39: }
40:
41: public Pattern getPattern() {
42: return mPattern;
43: }
44:
45: public boolean isRegexp() {
46: return mRegexp;
47: }
48:
49: }
|