001/**
002 * Copyright 2010-2014 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.common.util.config;
017
018import javax.xml.bind.annotation.XmlAccessType;
019import javax.xml.bind.annotation.XmlAccessorType;
020import javax.xml.bind.annotation.XmlAttribute;
021import javax.xml.bind.annotation.XmlRootElement;
022
023import org.kuali.common.util.Encodings;
024import org.kuali.common.util.Mode;
025
026/**
027 * @deprecated
028 */
029@XmlRootElement
030@XmlAccessorType(XmlAccessType.PROPERTY)
031@Deprecated
032public class Location {
033
034        public static final Mode DEFAULT_MISSING_MODE = Mode.ERROR;
035        public static final String DEFAULT_ENCODING = Encodings.UTF8;
036
037        Mode missingMode = DEFAULT_MISSING_MODE;
038        String encoding = DEFAULT_ENCODING;
039        String value;
040
041        public Location(Location location) {
042                super();
043                this.missingMode = location.getMissingMode();
044                this.encoding = location.getEncoding();
045                this.value = location.getValue();
046        }
047
048        public Location() {
049                this((String) null);
050        }
051
052        public Location(String value) {
053                this(value, DEFAULT_ENCODING, DEFAULT_MISSING_MODE);
054        }
055
056        public Location(String value, String encoding) {
057                this(value, encoding, DEFAULT_MISSING_MODE);
058        }
059
060        public Location(String value, String encoding, Mode missingMode) {
061                super();
062                this.missingMode = missingMode;
063                this.encoding = encoding;
064                this.value = value;
065        }
066
067        @XmlAttribute(name = "missing")
068        public Mode getMissingMode() {
069                return missingMode;
070        }
071
072        @XmlAttribute
073        public String getEncoding() {
074                return encoding;
075        }
076
077        @XmlAttribute
078        public String getValue() {
079                return value;
080        }
081
082        public void setMissingMode(Mode missingMode) {
083                this.missingMode = missingMode;
084        }
085
086        public void setEncoding(String encoding) {
087                this.encoding = encoding;
088        }
089
090        public void setValue(String value) {
091                this.value = value;
092        }
093
094}