View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.core.joran.action;
15  
16  import ch.qos.logback.core.joran.spi.ElementPath;
17  import org.xml.sax.Attributes;
18  
19  import ch.qos.logback.core.joran.spi.InterpretationContext;
20  
21  /**
22   * ImplcitActions are like normal (explicit) actions except that are applied
23   * by the parser when no other pattern applies. Since there can be many implicit
24   * actions, each action is asked whether it applies in the given context. The
25   * first implicit action to respond positively is then applied. See also the
26   * {@link #isApplicable} method.
27   *
28   * @author Ceki Gülcü
29   */
30  public abstract class ImplicitAction extends Action {
31  
32      /**
33       * Check whether this implicit action is appropriate in the current context.
34       * 
35       * @param currentElementPath This pattern contains the tag name of the current
36       * element being parsed at the top of the stack.
37       * @param attributes The attributes of the current element to process.
38       * @param ec
39       * @return Whether the implicit action is applicable in the current context
40       */
41      public abstract boolean isApplicable(ElementPath currentElementPath, Attributes attributes, InterpretationContext ec);
42  
43  }