01: package org.slf4j.migrator;
02:
03: import org.slf4j.migrator.line.EmptyRuleSet;
04: import org.slf4j.migrator.line.JCLRuleSet;
05: import org.slf4j.migrator.line.Log4jRuleSet;
06: import org.slf4j.migrator.line.RuleSet;
07:
08: /**
09: * This class runs Pattern matching with java.util.regex using Patterns defined
10: * in concrete implementations
11: *
12: * @author jean-noelcharpin
13: *
14: */
15: public abstract class RuleSetFactory {
16:
17: /**
18: * Return matcher implementation depending on the conversion mode
19: *
20: * @param conversionType
21: * @return AbstractMatcher implementation
22: */
23: public static RuleSet getMatcherImpl(int conversionType) {
24: switch (conversionType) {
25: case Constant.JCL_TO_SLF4J:
26: return new JCLRuleSet();
27: case Constant.LOG4J_TO_SLF4J:
28: return new Log4jRuleSet();
29: case Constant.NOP_TO_SLF4J:
30: return new EmptyRuleSet();
31: default:
32: return null;
33: }
34: }
35: }
|