001: /***************************************************************
002: * This file is part of the [fleXive](R) project.
003: *
004: * Copyright (c) 1999-2008
005: * UCS - unique computing solutions gmbh (http://www.ucs.at)
006: * All rights reserved
007: *
008: * The [fleXive](R) project is free software; you can redistribute
009: * it and/or modify it under the terms of the GNU General Public
010: * License as published by the Free Software Foundation;
011: * either version 2 of the License, or (at your option) any
012: * later version.
013: *
014: * The GNU General Public License can be found at
015: * http://www.gnu.org/copyleft/gpl.html.
016: * A copy is found in the textfile GPL.txt and important notices to the
017: * license from the author are found in LICENSE.txt distributed with
018: * these libraries.
019: *
020: * This library is distributed in the hope that it will be useful,
021: * but WITHOUT ANY WARRANTY; without even the implied warranty of
022: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
023: * GNU General Public License for more details.
024: *
025: * For further information about UCS - unique computing solutions gmbh,
026: * please see the company website: http://www.ucs.at
027: *
028: * For further information about [fleXive](R), please see the
029: * project website: http://www.flexive.org
030: *
031: *
032: * This copyright notice MUST APPEAR in all copies of the file!
033: ***************************************************************/package com.flexive.shared.value;
034:
035: import com.flexive.shared.FxLanguage;
036:
037: import java.io.Serializable;
038: import java.util.Map;
039:
040: /**
041: * A multilingual String
042: *
043: * @author Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
044: */
045: public class FxString extends FxValue<String, FxString> implements
046: Serializable {
047:
048: private static final long serialVersionUID = -1441854978719391696L;
049: public final static String EMPTY = "";
050:
051: public FxString(boolean multiLanguage,
052: Map<Long, String> translations) {
053: super (multiLanguage, translations);
054: }
055:
056: public FxString(boolean multiLanguage, long defaultLanguage,
057: Map<Long, String> translations) {
058: super (multiLanguage, defaultLanguage, translations);
059: }
060:
061: public FxString(boolean multiLanguage, long defaultLanguage,
062: String value) {
063: super (multiLanguage, defaultLanguage, value);
064: }
065:
066: public FxString(boolean multiLanguage, String value) {
067: super (multiLanguage, value);
068: }
069:
070: public FxString(Map<Long, String[]> translations, int pos) {
071: super (translations, pos);
072: }
073:
074: public FxString(FxString clone) {
075: super (clone);
076: }
077:
078: public FxString(Map<Long, String> translations) {
079: super (translations);
080: }
081:
082: public FxString(long defaultLanguage, Map<Long, String> translations) {
083: super ((defaultLanguage != FxLanguage.SYSTEM_ID),
084: defaultLanguage, translations);
085: }
086:
087: public FxString(long defaultLanguage, String value) {
088: super (defaultLanguage, value);
089: }
090:
091: public FxString(String value) {
092: super (value);
093: }
094:
095: /**
096: * {@inheritDoc}
097: */
098: @Override
099: public FxString copy() {
100: return new FxString(this );
101: }
102:
103: /**
104: * {@inheritDoc}
105: */
106: @Override
107: public String fromString(String value) {
108: return value;
109: }
110:
111: /**
112: * {@inheritDoc}
113: */
114: @Override
115: public boolean isImmutableValueType() {
116: return true;
117: }
118:
119: /**
120: * {@inheritDoc}
121: */
122: @Override
123: public Class<String> getValueClass() {
124: return String.class;
125: }
126: }
|