001: /*
002: * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
003: *
004: * http://izpack.org/
005: * http://izpack.codehaus.org/
006: *
007: * Copyright 2008 Ari Voutilainen
008: *
009: * Licensed under the Apache License, Version 2.0 (the "License");
010: * you may not use this file except in compliance with the License.
011: * You may obtain a copy of the License at
012: *
013: * http://www.apache.org/licenses/LICENSE-2.0
014: *
015: * Unless required by applicable law or agreed to in writing, software
016: * distributed under the License is distributed on an "AS IS" BASIS,
017: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018: * See the License for the specific language governing permissions and
019: * limitations under the License.
020: */
021:
022: package IzPack.TestLangPacks;
023:
024: /**
025: * Contains language file items.
026: *
027: * @author Ari Voutilainen
028: */
029: public class LanguageItem {
030: private String key = null;
031: private String value = null;
032: private String[] unknownAttrs = null;
033:
034: /**
035: * The default contructor of the class.
036: *
037: * @param key ID in the 'str' element.
038: * @param value Text in the 'str' element.
039: */
040: public LanguageItem(String key, String value) {
041: this .key = key;
042: this .value = value;
043: }
044:
045: /**
046: * Returns the ID in 'str' element.
047: */
048: public String GetKey() {
049: return key;
050: }
051:
052: /**
053: * Returns the text in 'str' element.
054: */
055: public String GetValue() {
056: return value;
057: }
058:
059: /**
060: * Returns the unknown attributes in 'str' element.
061: */
062: public String[] GetUnknownAttributes() {
063: return unknownAttrs;
064: }
065:
066: /**
067: * Sets the ID in 'str' element.
068: *
069: * @param key ID to set.
070: */
071: public void SetKey(String key) {
072: this .key = key;
073: }
074:
075: /**
076: * Sets the text in 'str' element.
077: *
078: * @param value Value to set.
079: */
080: public void SetValue(String value) {
081: this .value = value;
082: }
083:
084: /**
085: * Sets the unknown attributes in 'str' element.
086: *
087: * @param unknownAttrs String array containing unknown attributes. Each
088: * index contain element and attributes (not 'id' and
089: * 'txt').
090: */
091: public void SetUnknownAttributes(String[] unknownAttrs) {
092: if (unknownAttrs.length > 0) {
093: this .unknownAttrs = unknownAttrs;
094: }
095: }
096:
097: /**
098: * Checks whether given ID is the same as in this object.
099: *
100: * @param id ID to check.
101: * @return true if IDs are the same. false if not.
102: */
103: public boolean EqualsId(String id) {
104: return key.equals(id);
105: }
106: }
|