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.config;
17  
18  import javax.xml.bind.annotation.XmlAccessType;
19  import javax.xml.bind.annotation.XmlAccessorType;
20  import javax.xml.bind.annotation.XmlAttribute;
21  import javax.xml.bind.annotation.XmlRootElement;
22  
23  import org.kuali.common.util.Encodings;
24  import org.kuali.common.util.Mode;
25  
26  /**
27   * @deprecated
28   */
29  @XmlRootElement
30  @XmlAccessorType(XmlAccessType.PROPERTY)
31  @Deprecated
32  public class Location {
33  
34  	public static final Mode DEFAULT_MISSING_MODE = Mode.ERROR;
35  	public static final String DEFAULT_ENCODING = Encodings.UTF8;
36  
37  	Mode missingMode = DEFAULT_MISSING_MODE;
38  	String encoding = DEFAULT_ENCODING;
39  	String value;
40  
41  	public Location(Location location) {
42  		super();
43  		this.missingMode = location.getMissingMode();
44  		this.encoding = location.getEncoding();
45  		this.value = location.getValue();
46  	}
47  
48  	public Location() {
49  		this((String) null);
50  	}
51  
52  	public Location(String value) {
53  		this(value, DEFAULT_ENCODING, DEFAULT_MISSING_MODE);
54  	}
55  
56  	public Location(String value, String encoding) {
57  		this(value, encoding, DEFAULT_MISSING_MODE);
58  	}
59  
60  	public Location(String value, String encoding, Mode missingMode) {
61  		super();
62  		this.missingMode = missingMode;
63  		this.encoding = encoding;
64  		this.value = value;
65  	}
66  
67  	@XmlAttribute(name = "missing")
68  	public Mode getMissingMode() {
69  		return missingMode;
70  	}
71  
72  	@XmlAttribute
73  	public String getEncoding() {
74  		return encoding;
75  	}
76  
77  	@XmlAttribute
78  	public String getValue() {
79  		return value;
80  	}
81  
82  	public void setMissingMode(Mode missingMode) {
83  		this.missingMode = missingMode;
84  	}
85  
86  	public void setEncoding(String encoding) {
87  		this.encoding = encoding;
88  	}
89  
90  	public void setValue(String value) {
91  		this.value = value;
92  	}
93  
94  }