View Javadoc
1   /*
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2024, 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.model;
15  
16  import ch.qos.logback.core.joran.action.ActionUtil.Scope;
17  import ch.qos.logback.core.model.processor.ModelInterpretationContext;
18  import ch.qos.logback.core.model.util.PropertyModelHandlerHelper;
19  
20  import java.util.Properties;
21  
22  public class ModelUtil {
23  
24      
25      static public void resetForReuse(Model model) {
26          if(model == null)
27             return;
28          model.resetForReuse();
29      }
30  
31  
32  
33      /**
34       * Add all the properties found in the argument named 'props' to an
35       * ModelInterpretationContext.
36       *
37       * @deprecated moved to {@link PropertyModelHandlerHelper#setProperty}
38       */
39      @Deprecated
40      static public void setProperty(ModelInterpretationContext mic, String key, String value, Scope scope) {
41          PropertyModelHandlerHelper.setProperty(mic, key, value, scope);
42      }
43  
44      /**
45       * Add all the properties found in the argument named 'props' to an
46       * ModelInterpretationContext.
47       *
48       * @deprecated   moved to {@link PropertyModelHandlerHelper#setProperties}
49       */
50      @Deprecated
51      static public void setProperties(ModelInterpretationContext mic, Properties props, Scope scope) {
52          PropertyModelHandlerHelper.setProperties(mic, props, scope);
53      }
54  
55  }