1 19 20 package org.apache.james.test.mock.mailet; 21 22 import org.apache.mailet.MailetContext; 23 import org.apache.mailet.MatcherConfig; 24 25 28 public class MockMatcherConfig implements MatcherConfig { 29 30 private String matcherName; 31 32 private MailetContext mc; 33 34 public MockMatcherConfig(String matcherName, MailetContext mc) { 35 super(); 36 this.matcherName = matcherName; 37 this.mc = mc; 38 } 39 40 public String getCondition() { 41 if (matcherName.indexOf("=") >= 0) { 42 return matcherName.substring(getMatcherName().length() + 1); 43 } else { 44 return null; 45 } 46 } 47 48 public MailetContext getMailetContext() { 49 return mc; 50 } 51 52 public String getMatcherName() { 53 if (matcherName.indexOf("=") >= 0) { 54 return matcherName.split("=")[0]; 55 } else { 56 return matcherName; 57 } 58 } 59 60 } 61 | Popular Tags |