public class LocalizableText
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
MessageFormat
,
Serialized FormConstructor and Description |
---|
LocalizableText(java.lang.String code)
Creates a new instance withe the specified message code
|
LocalizableText(java.lang.String code,
java.lang.Object replacementValue)
Creates a new instance withe the specified message code and one replace
ment value.
|
LocalizableText(java.lang.String code,
java.lang.Object[] replacementValues)
Creates a new instance withe the specified message code and any
number of replacement values.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a 1:1 deep copy of this object.
|
boolean |
equals(java.lang.Object o)
Two instances of LocalizableText are considdered equal if they carry the same code,
and the same set of replacement objects.
|
java.lang.String |
getCode()
Returns the application internal code for this text object
|
java.lang.String |
getLanguage()
Returns the two letter language code this textobject was localized with
or null, if the textobject wasn't yet localized.
|
java.lang.String |
getText()
Returns the localized text.
|
protected java.lang.Object[] |
getVariables()
Inheriting classes may have to have access to the replacement values of this
object, but they should never be altered and are therefor sealed with a protected
accessor.
|
int |
hashCode()
Overridden to be consistent with equals;
|
void |
localize(Localizer loco)
Trys to translate the code into some human readable text using the specified
Localizer.
|
java.lang.String |
toString()
Returns the short name of this class followed by code and language
|
public LocalizableText(java.lang.String code)
code
- application internal code for some message textpublic LocalizableText(java.lang.String code, java.lang.Object replacementValue)
code
- application internal code for some message textreplacementValue
- used with java.text.MessageFormatpublic LocalizableText(java.lang.String code, java.lang.Object[] replacementValues)
code
- application internal code for some message textreplacementValues
- used with java.text.MessageFormatpublic java.lang.String getCode()
public java.lang.String getText()
public void localize(Localizer loco)
public java.lang.String getLanguage()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
Object.clone()
protected java.lang.Object[] getVariables()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()