Class InternationalStringImpl
- java.lang.Object
-
- com.sun.xml.registry.uddi.infomodel.InternationalStringImpl
-
- All Implemented Interfaces:
Serializable,javax.xml.registry.infomodel.InternationalString
public class InternationalStringImpl extends Object implements javax.xml.registry.infomodel.InternationalString, Serializable
Implementation of JAXR InternationalString. "default locale" in comments below refers to the locale given by Locale.getDefault() at runtime. Class contains a java.util.HashMap that maps locales to LocalizedString instances. Unless specified for a given method, the behavior for null locales and values is the same as for null keys and objects in HashMap.- Author:
- Bobby Bissett
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InternationalStringImpl()Default constructor creates empty hash map for holding LocalizedStrings.InternationalStringImpl(String value)Utility constructor used to set a string value for the default locale.InternationalStringImpl(Locale locale, String value)Utility constructor used with given locale and string.InternationalStringImpl(javax.xml.registry.infomodel.LocalizedString lString)Utility constructor used with a given LocalizedString.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLocalizedString(javax.xml.registry.infomodel.LocalizedString localizedString)Adds given localized string to collection.voidaddLocalizedStrings(Collection strings)Adds localized strings to the collection.javax.xml.registry.infomodel.LocalizedStringgetLocalizedString(Locale locale, String charsetName)Gets the localized string for the given locale, if one exists.CollectiongetLocalizedStrings()Get the localized strings contained in this international string.StringgetValue()Returns the string value for default localeStringgetValue(Locale locale)Returns the string value for the given locale.voidremoveLocalizedString(javax.xml.registry.infomodel.LocalizedString lString)Removes given localized string.voidremoveLocalizedStrings(Collection lStrings)Removes localized strings from the international string if they are present.voidsetValue(String string)Sets string value for default localevoidsetValue(Locale locale, String string)Sets the string value for the specified locale
-
-
-
Constructor Detail
-
InternationalStringImpl
public InternationalStringImpl()
Default constructor creates empty hash map for holding LocalizedStrings.
-
InternationalStringImpl
public InternationalStringImpl(javax.xml.registry.infomodel.LocalizedString lString) throws javax.xml.registry.JAXRExceptionUtility constructor used with a given LocalizedString.- Parameters:
string- LocalizedString to store- Throws:
javax.xml.registry.JAXRException
-
InternationalStringImpl
public InternationalStringImpl(Locale locale, String value)
Utility constructor used with given locale and string.- Parameters:
locale-value- String value for given locale
-
InternationalStringImpl
public InternationalStringImpl(String value)
Utility constructor used to set a string value for the default locale.- Parameters:
value- Store this value for the default locale
-
-
Method Detail
-
getValue
public String getValue() throws javax.xml.registry.JAXRException
Returns the string value for default locale- Specified by:
getValuein interfacejavax.xml.registry.infomodel.InternationalString- Throws:
javax.xml.registry.JAXRException
-
getValue
public String getValue(Locale locale) throws javax.xml.registry.JAXRException
Returns the string value for the given locale. If locale is null or there is no localized string for the given locale, the method will return null.- Specified by:
getValuein interfacejavax.xml.registry.infomodel.InternationalString- Throws:
javax.xml.registry.JAXRException
-
setValue
public void setValue(String string) throws javax.xml.registry.JAXRException
Sets string value for default locale- Specified by:
setValuein interfacejavax.xml.registry.infomodel.InternationalString- Throws:
javax.xml.registry.JAXRException
-
setValue
public void setValue(Locale locale, String string) throws javax.xml.registry.JAXRException
Sets the string value for the specified locale- Specified by:
setValuein interfacejavax.xml.registry.infomodel.InternationalString- Throws:
javax.xml.registry.JAXRException
-
addLocalizedString
public void addLocalizedString(javax.xml.registry.infomodel.LocalizedString localizedString) throws javax.xml.registry.JAXRExceptionAdds given localized string to collection. LocalizedString parameter cannot be null.- Specified by:
addLocalizedStringin interfacejavax.xml.registry.infomodel.InternationalString- Throws:
javax.xml.registry.JAXRException
-
addLocalizedStrings
public void addLocalizedStrings(Collection strings) throws javax.xml.registry.JAXRException
Adds localized strings to the collection. If there are multiple localized strings for the same locale, it is unspecified which one will be set for this international string.- Specified by:
addLocalizedStringsin interfacejavax.xml.registry.infomodel.InternationalString- Throws:
javax.xml.registry.JAXRException
-
removeLocalizedString
public void removeLocalizedString(javax.xml.registry.infomodel.LocalizedString lString) throws javax.xml.registry.JAXRExceptionRemoves given localized string. If the localized string is not in this international string, nothing happens. Parameter localized string cannot be null.- Specified by:
removeLocalizedStringin interfacejavax.xml.registry.infomodel.InternationalString- Throws:
javax.xml.registry.JAXRException
-
removeLocalizedStrings
public void removeLocalizedStrings(Collection lStrings) throws javax.xml.registry.JAXRException
Removes localized strings from the international string if they are present.- Specified by:
removeLocalizedStringsin interfacejavax.xml.registry.infomodel.InternationalString- Throws:
javax.xml.registry.JAXRException
-
getLocalizedString
public javax.xml.registry.infomodel.LocalizedString getLocalizedString(Locale locale, String charsetName) throws javax.xml.registry.JAXRException
Gets the localized string for the given locale, if one exists.- Specified by:
getLocalizedStringin interfacejavax.xml.registry.infomodel.InternationalString- Throws:
javax.xml.registry.JAXRException
-
getLocalizedStrings
public Collection getLocalizedStrings() throws javax.xml.registry.JAXRException
Get the localized strings contained in this international string. This method creates a new collection to return rather than the one that backs the hash map.- Specified by:
getLocalizedStringsin interfacejavax.xml.registry.infomodel.InternationalString- Throws:
javax.xml.registry.JAXRException
-
-