001/**
002 * Logback: the reliable, generic, fast and flexible logging framework.
003 * Copyright (C) 1999-2025, 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 */
014
015package ch.qos.logback.core.boolex;
016
017import ch.qos.logback.core.Context;
018import ch.qos.logback.core.joran.conditional.Condition;
019import ch.qos.logback.core.spi.ContextAware;
020import ch.qos.logback.core.spi.LifeCycle;
021import ch.qos.logback.core.spi.PropertyContainer;
022
023/**
024 * Interface for evaluating conditions based on properties during the conditional processing
025 * of Logback configuration files. This interface is intended to provide an
026 * alternative to legacy Janino-based evaluation.
027 * <p>
028 * Implementations of this interface can access both global properties from the {@link Context}
029 * and local properties specific to the embedding configurator instance. This allows for fine-grained
030 * and context-aware evaluation of configuration conditions.
031 * </p>
032 *
033 * <p>
034 * Typical usage involves implementing this interface to provide custom logic for evaluating
035 * whether certain configuration blocks should be included or excluded based on property values.
036 * </p>
037 *
038 * @since 1.5.20
039 * @author Ceki G&uuml;lc&uuml;
040 */
041public interface PropertyCondition extends Condition, ContextAware, LifeCycle {
042
043    /**
044     * Returns the local {@link PropertyContainer} used for property lookups specific to the embedding configurator.
045     * This is distinct from the global {@link Context} property container.
046     *
047     * @return the local property container, or null if not set
048     */
049    public PropertyContainer getLocalPropertyContainer();
050
051    /**
052     * Sets a {@link PropertyContainer} specific to the embedding configurator, which is used for property lookups
053     * in addition to the global {@link Context} properties. This allows for overriding or supplementing global properties
054     * with local values during evaluation.
055     *
056     * @param aPropertyContainer the local property container to use for lookups
057     */
058    public void setLocalPropertyContainer(PropertyContainer aPropertyContainer);
059
060
061}