001/**
002 * Logback: the reliable, generic, fast and flexible logging framework.
003 * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
004 *
005 * This program and the accompanying materials are dual-licensed under
006 * either the terms of the Eclipse Public License v1.0 as published by
007 * the Eclipse Foundation
008 *
009 *   or (per the licensee's choosing)
010 *
011 * under the terms of the GNU Lesser General Public License version 2.1
012 * as published by the Free Software Foundation.
013 */
014package ch.qos.logback.core.joran.action;
015
016import ch.qos.logback.core.joran.spi.ElementPath;
017import org.xml.sax.Attributes;
018
019import ch.qos.logback.core.joran.spi.InterpretationContext;
020
021/**
022 * ImplcitActions are like normal (explicit) actions except that are applied
023 * by the parser when no other pattern applies. Since there can be many implicit
024 * actions, each action is asked whether it applies in the given context. The
025 * first implicit action to respond positively is then applied. See also the
026 * {@link #isApplicable} method.
027 *
028 * @author Ceki Gülcü
029 */
030public abstract class ImplicitAction extends Action {
031
032    /**
033     * Check whether this implicit action is appropriate in the current context.
034     * 
035     * @param currentElementPath This pattern contains the tag name of the current
036     * element being parsed at the top of the stack.
037     * @param attributes The attributes of the current element to process.
038     * @param ec
039     * @return Whether the implicit action is applicable in the current context
040     */
041    public abstract boolean isApplicable(ElementPath currentElementPath, Attributes attributes, InterpretationContext ec);
042
043}