View Javadoc
1   /**
2    * Copyright 2010-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.common.util.log4j.model;
17  
18  import java.util.ArrayList;
19  import java.util.Arrays;
20  import java.util.List;
21  
22  import javax.xml.bind.annotation.XmlAttribute;
23  import javax.xml.bind.annotation.XmlElement;
24  
25  import org.kuali.common.util.CollectionUtils;
26  
27  /**
28   * @deprecated
29   */
30  @Deprecated
31  public class Logger {
32  
33  	public static final Boolean DEFAULT_ADDITIVITY_VALUE = true;
34  
35  	Boolean additivity = DEFAULT_ADDITIVITY_VALUE;
36  	String name;
37  	List<AppenderRef> references = new ArrayList<AppenderRef>();
38  	Level level;
39  
40  	public Logger() {
41  		this((String) null);
42  	}
43  
44  	public Logger(List<AppenderRef> references) {
45  		this(null, references);
46  	}
47  
48  	public Logger(AppenderRef reference, Level level) {
49  		this(Arrays.asList(reference), level);
50  	}
51  
52  	public Logger(List<AppenderRef> references, Level level) {
53  		this(null, references, level);
54  	}
55  
56  	public Logger(String name) {
57  		this(name, (Level) null);
58  	}
59  
60  	public Logger(String name, Level level) {
61  		this(name, null, level);
62  	}
63  
64  	public Logger(String name, List<AppenderRef> references) {
65  		this(name, references, null);
66  	}
67  
68  	public Logger(String name, List<AppenderRef> references, Level level) {
69  		super();
70  		this.name = name;
71  		this.references = references;
72  		this.level = level;
73  	}
74  
75  	public Logger(Logger logger) {
76  		super();
77  		this.additivity = logger.getAdditivity();
78  		this.name = logger.getName();
79  		this.level = logger.getLevel();
80  		for (AppenderRef reference : CollectionUtils.toEmptyList(logger.getReferences())) {
81  			this.references.add(new AppenderRef(reference));
82  		}
83  	}
84  
85  	@XmlElement(name = "appender-ref")
86  	public List<AppenderRef> getReferences() {
87  		return references;
88  	}
89  
90  	@XmlAttribute
91  	public Boolean getAdditivity() {
92  		return additivity;
93  	}
94  
95  	@XmlAttribute
96  	public String getName() {
97  		return name;
98  	}
99  
100 	public void setAdditivity(Boolean additivity) {
101 		this.additivity = additivity;
102 	}
103 
104 	public void setName(String name) {
105 		this.name = name;
106 	}
107 
108 	public void setReferences(List<AppenderRef> references) {
109 		this.references = references;
110 	}
111 
112 	public Level getLevel() {
113 		return level;
114 	}
115 
116 	public void setLevel(Level level) {
117 		this.level = level;
118 	}
119 
120 }