|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opcfoundation.ua.builtintypes.LocalizedText
public final class LocalizedText
This primitive DataType is specified as a string that is composed of a
language component and a country/region component as specified by RFC 3066.
The <country/region> component is always preceded by a hyphen. The format of
the LocaleId string is shown below:
<language>[-<country/region>], where <language> is the two letter ISO 639
code for a language, <country/region> is the two letter ISO 3166 code for
the country/region.
The rules for constructing LocaleIds defined by RFC 3066 are restricted for
OPC UA as follows:
d) OPC UA permits only zero or one <country/region> component to follow the
<language> component,
e) OPC UA also permits the "-CHS" and "-CHT" three-letter <country/region>
codes for "Simplified" and "Traditional" Chinese locales.
f) OPC UA also allows the use of other <country/region> codes as deemed
necessary by the client or the server.
Example:
English en
English (US) en-US
German de
German (Germany) de-DE
German (Austrian) de-AT
See Country Codes http://www.iso.org/iso/english_country_names_and_code_elements
See Language Codes http://www.loc.gov/standards/iso639-2/php/English_list.php
http://www.ietf.org/rfc/rfc3066.txt,
Locale| Field Summary | |
|---|---|
static LocalizedText |
EMPTY
|
static LocalizedText |
EMPTY_EN
|
static NodeId |
ID
|
static Pattern |
LOCALE_PATTERN
The pattern of the locale part |
static Locale |
NO_LOCALE
|
static LocalizedText |
NULL
|
static Locale |
NULL_LOCALE
|
| Constructor Summary | |
|---|---|
LocalizedText(String text)
Create new Localized Text with locale NO_LOCALE |
|
LocalizedText(String text,
Locale locale)
Create new localized text |
|
LocalizedText(String text,
String localeId)
Create new Localized Text |
|
| Method Summary | |
|---|---|
static LocalizedText |
english(String text)
Create a english text |
boolean |
equals(Object obj)
|
Locale |
getLocale()
Get locale object |
String |
getLocaleId()
Get the whole locale string |
String |
getText()
|
int |
hashCode()
|
static Locale |
toLocale(String localeId)
Convert UA LocateId to Locale |
static String |
toLocaleId(Locale locale)
Convert Locale to UA LocaleId String |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Pattern LOCALE_PATTERN
public static final Locale NO_LOCALE
public static final Locale NULL_LOCALE
public static final NodeId ID
public static final LocalizedText NULL
public static final LocalizedText EMPTY
public static final LocalizedText EMPTY_EN
| Constructor Detail |
|---|
public LocalizedText(String text,
String localeId)
text - Localized text or nulllocaleId - <language>[-<country/region>] or nullpublic LocalizedText(String text)
text - the text
public LocalizedText(String text,
Locale locale)
text - or nulllocale - locale or null| Method Detail |
|---|
public static Locale toLocale(String localeId)
Locale
localeId - or null
public static String toLocaleId(Locale locale)
Locale to UA LocaleId String
locale - locale or null
public static LocalizedText english(String text)
text - string
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String getLocaleId()
public Locale getLocale()
public String getText()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||