Examples of ElementSelector


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

  }

 
  @Override
  protected void addInstanceRules(RuleStore rs) {
    rs.addRule(new ElementSelector("fruitShell"), new NOPAction());
  }
View Full Code Here

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

  public List<FruitShell> doFirstPart(String filename) throws Exception {

    try {
      HashMap<ElementSelector, Action> rulesMap = new HashMap<ElementSelector, Action>();
      rulesMap.put(new ElementSelector("group/fruitShell"), new FruitShellAction());
      rulesMap.put(new ElementSelector("group/fruitShell/fruit"),
          new FruitFactoryAction());
      rulesMap.put(new ElementSelector("group/fruitShell/fruit/*"), new NOPAction());
      SimpleConfigurator simpleConfigurator = new SimpleConfigurator(rulesMap);

      simpleConfigurator.setContext(fruitContext);

      simpleConfigurator.doConfigure(CoreTestConstants.TEST_SRC_PREFIX + "input/joran/replay/"
View Full Code Here

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

  @Test
  public void testBasic() throws JoranException {
    ListenAction listenAction = new ListenAction();
   
    rulesMap.put(new ElementSelector("fire"), listenAction);
    TrivialConfigurator gc = new TrivialConfigurator(rulesMap);

    gc.setContext(context);
    gc.doConfigure(CoreTestConstants.TEST_SRC_PREFIX + "input/joran/fire1.xml");
   
View Full Code Here

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

  @Test
  public void testReplay() throws JoranException {
    ListenAction listenAction = new ListenAction();
   
    rulesMap.put(new ElementSelector("fire"), listenAction);
    TrivialConfigurator gc = new TrivialConfigurator(rulesMap);

    gc.setContext(context);
    gc.doConfigure(CoreTestConstants.TEST_SRC_PREFIX + "input/joran/fire1.xml");
   
View Full Code Here

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

  @Before
  public void setUp() throws Exception {
    fruitContext.setName("fruits");
    HashMap<ElementSelector, Action> rulesMap = new HashMap<ElementSelector, Action>();
    rulesMap.put(new ElementSelector("/context/"), new FruitContextAction());
    simpleConfigurator = new SimpleConfigurator(rulesMap);
    simpleConfigurator.setContext(fruitContext);
  }
View Full Code Here

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

    Context context = new ContextBase();

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

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

    // 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 ElementSelector("/computation/newRule"), new NewRuleAction());

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

View Full Code Here

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

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

    // Associate "hello-world" pattern with HelloWorldAction
    ruleMap.put(new ElementSelector("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

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

    Context context = new ContextBase();

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

    // Associate "/computation" pattern with ComputationAction1
    ruleMap.put(new ElementSelector("/computation"), new ComputationAction1());

    // Other associations
    ruleMap.put(new ElementSelector("/computation/literal"), new LiteralAction());
    ruleMap.put(new ElementSelector("/computation/add"), new AddAction());
    ruleMap.put(new ElementSelector("/computation/multiply"), new MultiplyAction());

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

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

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

    ruleMap.put(new ElementSelector("*/computation/literal"), new LiteralAction());
    ruleMap.put(new ElementSelector("*/computation/add"), new AddAction());
    ruleMap.put(new ElementSelector("*/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

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

    Context context = new ContextBase();

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

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

    // Add an implicit action.
    List<ImplicitAction> iaList = new ArrayList<ImplicitAction>();
    iaList.add(new PrintMeImplicitAction());
    SimpleConfigurator simpleConfigurator = new SimpleConfigurator(ruleMap,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.