View Javadoc

1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2009, 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  
17  import org.xml.sax.Attributes;
18  
19  import ch.qos.logback.core.joran.spi.InterpretationContext;
20  import ch.qos.logback.core.joran.spi.Pattern;
21  
22  
23  /**
24   * ImplcitActions are like normal (explicit) actions except that are applied
25   * by the parser when no other pattern applies. Since there can be many implicit
26   * actions, each action is asked whether it applies in the given context. The
27   * first implicit action to respond positively is then applied. See also the
28   * {@link #isApplicable} method.
29   *
30   * @author Ceki Gülcü
31   */
32  public abstract class ImplicitAction extends Action {
33    
34    /**
35     * Check whether this implicit action is appropriate in the current context.
36     * 
37     * @param currentPattern This pattern contains the tag name of the current 
38     * element being parsed at the top of the stack.
39     * @param attributes The attributes of the current element to process.
40     * @param ec
41     * @return Whether the implicit action is applicable in the current context
42     */
43    public abstract boolean isApplicable(
44      Pattern currentPattern, Attributes attributes, InterpretationContext ec);
45    
46    
47  }