View Javadoc

1   package org.lsst.ccs.bootstrap.util;
2   
3   import java.util.regex.Matcher;
4   import java.util.regex.Pattern;
5   
6   /**
7    *
8    * @author turri
9    */
10  public class SystemPropertyMatcher {
11  
12      private static final Pattern systemPropertiesPattern = Pattern.compile("-D([^=]*)([=]?)(.*)");
13      private Matcher m;
14  
15      public SystemPropertyMatcher(String str) {
16          m = systemPropertiesPattern.matcher(str);        
17      }
18      
19      public boolean matches() {
20          return m.matches();
21      }
22      
23      public String getProperty() {
24          return m.group(1);
25      }
26      
27      public String getValue() {
28          return m.group(3);
29      }
30      
31      public String getSeparator() {
32          return m.group(2);
33      }
34      
35      public static SystemPropertyMatcher matcher(String str) {
36          return new SystemPropertyMatcher(str);
37      }
38  }