Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Logback: the reliable, generic, fast and flexible logging framework. Copyright (C) 1999-2011, QOS.ch. All rights reserved. This program and the accompanying materials are dual-licensed under either the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation or (per the licensee's choosing) under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.
 
 package ch.qos.logback.core.joran;
 
 import java.util.List;
 import java.util.Map;
 
 
 // Based on 310985 revision 310985 as attested by http://tinyurl.com/8njps
 // see also http://tinyurl.com/c2rp5
 
A JoranConfiguratorBase lays most of the groundwork for concrete configurators derived from it. Concrete configurators only need to implement the addInstanceRules(ch.qos.logback.core.joran.spi.RuleStore) method.

A JoranConfiguratorBase instance should not be used more than once to configure a Context.

Author(s):
Ceki Gülcü
 
 abstract public class JoranConfiguratorBase extends GenericConfigurator {
 
   public List getErrorList() {
     return null;
   }
 
   @Override
   protected void addInstanceRules(RuleStore rs) {
 
     rs.addRule(new Pattern("configuration/variable"), new PropertyAction());
     rs.addRule(new Pattern("configuration/property"), new PropertyAction());
 
     rs.addRule(new Pattern("configuration/substitutionProperty"),
         new PropertyAction());
 
     rs.addRule(new Pattern("configuration/timestamp"), new TimestampAction());
 
     rs.addRule(new Pattern("configuration/define"), new DefinePropertyAction());
 
     // the contextProperty pattern is deprecated. It is undocumented
     // and will be dropped in future versions of logback
     rs.addRule(new Pattern("configuration/contextProperty"),
         new ContextPropertyAction());
 
     rs.addRule(new Pattern("configuration/conversionRule"),
         new ConversionRuleAction());
 
     rs.addRule(new Pattern("configuration/statusListener"),
         new StatusListenerAction());
 
     rs.addRule(new Pattern("configuration/appender"), new AppenderAction());
     rs.addRule(new Pattern("configuration/appender/appender-ref"),
         new AppenderRefAction());
     rs.addRule(new Pattern("configuration/newRule"), new NewRuleAction());
     rs.addRule(new Pattern("*/param"), new ParamAction());
   }
 
   @Override
   protected void addImplicitRules(Interpreter interpreter) {
     // The following line adds the capability to parse nested components
     NestedComplexPropertyIA nestedComplexPropertyIA = new NestedComplexPropertyIA();
     nestedComplexPropertyIA.setContext();
     interpreter.addImplicitAction(nestedComplexPropertyIA);
 
     NestedBasicPropertyIA nestedBasicIA = new NestedBasicPropertyIA();
     nestedBasicIA.setContext();
     interpreter.addImplicitAction(nestedBasicIA);
   }
 
  protected void buildInterpreter() {
    super.buildInterpreter();
        .getObjectMap();
    omap.put(.new HashMap());
    omap.put(.new HashMap());
  }
  }
New to GrepCode? Check out our FAQ X