1   /*
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2026, 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 v2.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  
15  package ch.qos.logback.core.boolex;
16  
17  import ch.qos.logback.core.Context;
18  import ch.qos.logback.core.joran.conditional.Condition;
19  import ch.qos.logback.core.spi.ContextAware;
20  import ch.qos.logback.core.spi.LifeCycle;
21  import ch.qos.logback.core.spi.PropertyContainer;
22  
23  /**
24   * Interface for evaluating conditions based on properties during the conditional processing
25   * of Logback configuration files. This interface is intended to provide an
26   * alternative to legacy Janino-based evaluation.
27   * <p>
28   * Implementations of this interface can access both global properties from the {@link Context}
29   * and local properties specific to the embedding configurator instance. This allows for fine-grained
30   * and context-aware evaluation of configuration conditions.
31   * </p>
32   *
33   * <p>
34   * Typical usage involves implementing this interface to provide custom logic for evaluating
35   * whether certain configuration blocks should be included or excluded based on property values.
36   * </p>
37   *
38   * @since 1.5.20
39   * @author Ceki G&uuml;lc&uuml;
40   */
41  public interface PropertyCondition extends Condition, ContextAware, LifeCycle {
42  
43      /**
44       * Returns the local {@link PropertyContainer} used for property lookups specific to the embedding configurator.
45       * This is distinct from the global {@link Context} property container.
46       *
47       * @return the local property container, or null if not set
48       */
49      public PropertyContainer getLocalPropertyContainer();
50  
51      /**
52       * Sets a {@link PropertyContainer} specific to the embedding configurator, which is used for property lookups
53       * in addition to the global {@link Context} properties. This allows for overriding or supplementing global properties
54       * with local values during evaluation.
55       *
56       * @param aPropertyContainer the local property container to use for lookups
57       */
58      public void setLocalPropertyContainer(PropertyContainer aPropertyContainer);
59  
60  
61  }