001/*
002 * Logback: the reliable, generic, fast and flexible logging framework.
003 * Copyright (C) 1999-2024, 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.model;
015
016import ch.qos.logback.core.joran.action.ActionUtil.Scope;
017import ch.qos.logback.core.model.processor.ModelInterpretationContext;
018import ch.qos.logback.core.model.util.PropertyModelHandlerHelper;
019
020import java.util.Properties;
021
022public class ModelUtil {
023
024    
025    static public void resetForReuse(Model model) {
026        if(model == null)
027           return;
028        model.resetForReuse();
029    }
030
031
032
033    /**
034     * Add all the properties found in the argument named 'props' to an
035     * ModelInterpretationContext.
036     *
037     * @deprecated moved to {@link PropertyModelHandlerHelper#setProperty}
038     */
039    @Deprecated
040    static public void setProperty(ModelInterpretationContext mic, String key, String value, Scope scope) {
041        PropertyModelHandlerHelper.setProperty(mic, key, value, scope);
042    }
043
044    /**
045     * Add all the properties found in the argument named 'props' to an
046     * ModelInterpretationContext.
047     *
048     * @deprecated   moved to {@link PropertyModelHandlerHelper#setProperties}
049     */
050    @Deprecated
051    static public void setProperties(ModelInterpretationContext mic, Properties props, Scope scope) {
052        PropertyModelHandlerHelper.setProperties(mic, props, scope);
053    }
054
055}