KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > state > config > StatePattern


1 package org.sapia.soto.state.config;
2
3 import org.sapia.soto.util.matcher.PathPattern;
4
5
6 /**
7  * @author Yanick Duchesne
8  * <dl>
9  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
10  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
11  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
12  * </dl>
13  */

14 public class StatePattern {
15   private PathPattern _pattern;
16
17   public StatePattern() {
18   }
19
20   public void setId(String JavaDoc pattern) {
21     setPattern(pattern);
22   }
23
24   public void setPattern(String JavaDoc pattern) {
25     _pattern = PathPattern.parse(pattern, true);
26   }
27
28   public boolean matches(String JavaDoc stateId) {
29     return _pattern.matches(stateId);
30   }
31 }
32
Popular Tags