Package ch.qos.logback.core.joran.spi

Examples of ch.qos.logback.core.joran.spi.Pattern


    }

    try {
      addInfo("About to add new Joran parsing rule [" + pattern + ","
          + actionClass + "].");
      ec.getJoranInterpreter().getRuleStore().addRule(new Pattern(pattern),
          actionClass);
    } catch (Exception oops) {
      inError = true;
      errorMsg = "Could not add new Joran parsing rule [" + pattern + ","
          + actionClass + "]";
View Full Code Here


    return null;
  }

  @Override
  protected void addInstanceRules(RuleStore rs) {
    rs.addRule(new Pattern("configuration/substitutionProperty"),
        new SubstitutionPropertyAction());
    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());
  }
View Full Code Here

  public void startElement(String namespaceURI, String localName, String qName,
      Attributes atts) {

    String tagName = getTagName(localName, qName);
    globalPattern.push(tagName);
    Pattern current = (Pattern) globalPattern.clone();
    saxEventList.add(new StartEvent(current, namespaceURI, localName, qName,
        atts, getLocator()));
  }
View Full Code Here

  @Override
  public void addInstanceRules(RuleStore rs) {
    super.addInstanceRules(rs);
   
    rs.addRule(new Pattern("configuration"), new ConfigurationAction());
    rs.addRule(new Pattern("configuration/appender-ref"), new AppenderRefAction());
   
    rs.addRule(new Pattern("configuration/appender/sift"), new SiftAction());
    rs.addRule(new Pattern("configuration/appender/sift/*"), new NOPAction());
   
    rs.addRule(new Pattern("configuration/evaluator"), new EvaluatorAction());
  }
View Full Code Here

 
   
    Map<Pattern, Action> ruleMap = new HashMap<Pattern, Action>();

    // we start with the rule for the top-most (root) element
    ruleMap.put(new Pattern("*/computation"), new ComputationAction2());

    // Associate "/new-rule" pattern with NewRuleAction from the
    // org.apache.joran.action package.
    //
    // We will let the XML file to teach the Joran interpreter about new rules
    ruleMap.put(
      new Pattern("/computation/new-rule"), new NewRuleAction());

    SimpleConfigurator simpleConfigurator = new SimpleConfigurator(ruleMap);
    // link the configurator with its context
    simpleConfigurator.setContext(context);

View Full Code Here

public class HelloWorld {
  public static void main(String[] args) throws Exception {
    Map<Pattern, Action> ruleMap = new HashMap<Pattern, Action>();

    // Associate "hello-world" pattern with  HelloWorldAction
    ruleMap.put(new Pattern("hello-world"), new HelloWorldAction());

    // Joran needs to work within a context.
    Context context = new ContextBase();
    SimpleConfigurator simpleConfigurator = new SimpleConfigurator(ruleMap);
    // link the configurator with its context
View Full Code Here

    this.value = value;
  }
 
  @Override
  protected Pattern initialPattern() {
    return new Pattern("configuration");
  }
View Full Code Here

    return new Pattern("configuration");
  }
 
  @Override
  protected void addInstanceRules(RuleStore rs) {
    rs.addRule(new Pattern("configuration/appender"), new AppenderAction());
  }
View Full Code Here

    Map<Pattern, Action> ruleMap = new HashMap<Pattern, Action>();
  
   
    // Note the wild card character '*', in the paterns, signifying any level
    // of nesting.
    ruleMap.put(new Pattern("*/computation"), new ComputationAction2());

    ruleMap.put(new Pattern("*/computation/literal"), new LiteralAction());
    ruleMap.put(new Pattern("*/computation/add"), new AddAction());
    ruleMap.put(new Pattern("*/computation/multiply"), new MultiplyAction());
   
    Context context = new ContextBase();
    SimpleConfigurator simpleConfigurator = new SimpleConfigurator(ruleMap);
    // link the configurator with its context
    simpleConfigurator.setContext(context);
View Full Code Here

   
    Map<Pattern, Action> ruleMap = new HashMap<Pattern, Action>();

   
    // we start with the rule for the top-most (root) element
    ruleMap.put(new Pattern("*/foo"), new NOPAction());


    List<ImplicitAction> iaList = new ArrayList<ImplicitAction>();
    // --------------------------+
    // Add an implicit action.   |
View Full Code Here

TOP

Related Classes of ch.qos.logback.core.joran.spi.Pattern

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.