Beispiel #1
0
 public void setRoot(String s) {
   String root = Static.trim2(s, null);
   if (root != null) {
     this.accu = new Element(s);
     this.accu.addContent("\n");
   }
 }
Beispiel #2
0
 /**
  * compile a string a regular expression pattern. In case of an error, the internal variable
  * <code>errmsg</code> is set.
  *
  * @return nil if <code>s</code> can't be translated.
  */
 protected final Pattern compile(String S) {
   String s = S;
   Pattern P = null;
   if (s != null && s.trim().length() > 0) {
     try {
       if (this.glob) {
         s = Static.patternAsRegex(s);
         P = Pattern.compile(s, this.flags);
       } else {
         P = Static.patterncompile(s, this.flags);
       }
     } catch (Exception e) {
       this.errmsg = e.toString();
     }
   }
   return P;
 }
Beispiel #3
0
  private void initFilter() throws BuildException {
    try {
      if (this.filter == null && this.pattern != null) {
        this.filter = Static.patterncompile(this.pattern, 0);
      }

      this.ffilter =
          new FileFilter() {
            public boolean accept(File file) {
              String s;
              if (file.isDirectory()) return true;
              if (XmlMerger.this.filter == null) return true;
              s = file.getName();
              if (s == null) return false;
              return XmlMerger.this.filter.matcher(s).matches();
            }
          };
    } catch (Exception e) {
      throw new BuildException(e);
    }
  }
Beispiel #4
0
 public void setPattern(String pattern) {
   this.pattern = Static.trim2(pattern, this.pattern);
   this.doinit = true;
 }
Beispiel #5
0
 public void setSrc(String s) {
   this.src = Static.trim2(s, this.src);
 }
Beispiel #6
0
 public void setDst(String s) {
   this.dst = Static.trim2(s, this.src);
 }
Beispiel #7
0
 /**
  * Use attribute <code>refid</code> to change the reference holding all known dependencies.
  *
  * @param s
  */
 public void setRefid(String s) {
   this.refid = Static.trim2(s, this.refid);
 }
Beispiel #8
0
 public void setVersion(String s) {
   this.version_regex = Static.trim2(s, this.version_regex);
 }
Beispiel #9
0
 public void setGroupid(String s) {
   this.gid_regex = Static.trim2(s, this.gid_regex);
 }
Beispiel #10
0
 public void setType(String s) {
   this.type_regex = Static.trim2(s, this.type_regex);
 }
Beispiel #11
0
 public void setBasename(String s) {
   this.bname_regex = Static.trim2(s, this.bname_regex);
 }
Beispiel #12
0
 public void setScope(String s) {
   this.scope_regex = Static.trim2(s, this.scope_regex);
 }
Beispiel #13
0
 public void setAlias(String s) {
   this.alias_regex = Static.trim2(s, this.alias_regex);
 }